com.ibm.carma.ui.action
Class OpenWithActionMenu

java.lang.Object
  extended by org.eclipse.jface.action.ContributionItem
      extended by com.ibm.carma.ui.action.OpenWithActionMenu
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem

public class OpenWithActionMenu
extends org.eclipse.jface.action.ContributionItem

Action which contributes a menu displaying the available editors for the given CARMA member selection. The list of available editors is based on the file extension of the given CARMA Member.

This class may be instantiated and used without further configuration; this class is not intended to be subclassed.

Example:

 OpenWithActionMenu openWithActionMenu = new OpenWithActionMenu();
 openWithActionMenu.updateSelection(selection);
 MenuManager openWith= new MenuManager("Open with...", CarmaUIPlugin.PLUGIN_ID+ ".OpenWithSubMenu"); //$NON-NLS-1$
 openWith.add(openWithActionMenu);
 ....  
 

This Class is not intended to be subclassed, or instantiated.

Since:
7.0

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String ID
           
 
Constructor Summary
OpenWithActionMenu()
          Creates an open with menu
 
Method Summary
 void dispose()
           
 void fill(org.eclipse.swt.widgets.Menu menu, int index)
           
 boolean isDynamic()
           
 boolean isEnabled()
           
 void setActionState(RAMActionState state)
          Sets the display state of the menu
 void setEnabled(boolean enabled)
           
 void updateSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
          Updates the current selection of the menu.
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
fill, fill, fill, getId, getParent, isDirty, isGroupMarker, isSeparator, isVisible, saveWidgetState, setParent, setVisible, toString, update, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values
Constructor Detail

OpenWithActionMenu

public OpenWithActionMenu()
Creates an open with menu

Method Detail

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.jface.action.IContributionItem
Overrides:
dispose in class org.eclipse.jface.action.ContributionItem

updateSelection

public void updateSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
Updates the current selection of the menu. Only a single item is expected in the selection.

Parameters:
selection - new selection for the menu

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - the enabled to set

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface org.eclipse.jface.action.IContributionItem
Overrides:
isEnabled in class org.eclipse.jface.action.ContributionItem

setActionState

public void setActionState(RAMActionState state)
Sets the display state of the menu

Parameters:
state - the display state of the menu

fill

public void fill(org.eclipse.swt.widgets.Menu menu,
                 int index)
Specified by:
fill in interface org.eclipse.jface.action.IContributionItem
Overrides:
fill in class org.eclipse.jface.action.ContributionItem

isDynamic

public boolean isDynamic()
Specified by:
isDynamic in interface org.eclipse.jface.action.IContributionItem
Overrides:
isDynamic in class org.eclipse.jface.action.ContributionItem