net.refractions.udig.ui.operations
Class OpCategoryContributionItem

java.lang.Object
  extended by CompoundContributionItem
      extended by net.refractions.udig.ui.operations.OpCategoryContributionItem

public class OpCategoryContributionItem
extends CompoundContributionItem

Used to fold an operation category into a menu or tool action bar.

This is performed with the following menu:

 <extension
    point="org.eclipse.ui.menus">
    ...
    <menuContribution
      locationURI="menu:data">
      <separator
        name="mbStart">
      </separator>
      <dynamic
      class="net.refractions.udig.ui.operations.OpCategoryContributionItem:net.refractions.udig.catalog.ui.operation.resourceCategory"
      id="resource.ext">
        <visibleWhen
          checkEnabled="true">
        </visibleWhen>
      </dynamic>
     ...
    <.menuContribution>   
  </extension>
 
After the ActionBarAdvisor (example UDIGActionBarAdvisor) for your RCP application has been called; the *org.eclipse.ui.menu* extension point is processed.

The above dynamic entry will call this class and provide the id of the operation category (via the IExecutableExtension) setInitializationData method.

When action bars are doing there thing they will call this dynamic menu and the class will use iPlugin.getDefault().getOperationMenuFactory() to locate the OperationCategory.

Based on the number of items in the OperationCategory this dynamic menu contribution will:

Author:
Jody Garnett

Constructor Summary
OpCategoryContributionItem()
          Default constructor - called by org.eclipse.ui.menus extention point.
OpCategoryContributionItem(java.lang.String id)
          I would love to know how or when this is called; my best guess is an IExecutableExtention wrapper is supposed to call this one but I cannot get it to work properly.
 
Method Summary
protected  IContributionItem[] getContributionItems()
          Generate an array of contribution items; these items are cached (so visibility is the key to controlling this list rather than inclusion).
 void setInitializationData(IConfigurationElement config, java.lang.String propertyName, java.lang.Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpCategoryContributionItem

public OpCategoryContributionItem()
Default constructor - called by org.eclipse.ui.menus extention point.


OpCategoryContributionItem

public OpCategoryContributionItem(java.lang.String id)
I would love to know how or when this is called; my best guess is an IExecutableExtention wrapper is supposed to call this one but I cannot get it to work properly.

Parameters:
id - I would love this to be the id of the operation category
Method Detail

getContributionItems

protected IContributionItem[] getContributionItems()
Generate an array of contribution items; these items are cached (so visibility is the key to controlling this list rather than inclusion).

Based on the number of actions in the OperationCategory provided:


setInitializationData

public void setInitializationData(IConfigurationElement config,
                                  java.lang.String propertyName,
                                  java.lang.Object data)
                           throws CoreException
Throws:
CoreException