|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.rse.ui.actions.SystemBaseAction
org.eclipse.rse.ui.actions.SystemBaseSubMenuAction
public abstract class SystemBaseSubMenuAction
Our framework is designed to allow actions to be added to popup menus. Sometimes, we want an expandable or cascading menu item for an action. That is what this class is designed for. It represents a populated submenu.
Field Summary | |
---|---|
protected String |
actionLabel
|
protected boolean |
createMenuEachTime
|
protected String |
menuID
|
protected boolean |
populateMenuEachTime
|
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseAction |
---|
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor |
Fields inherited from interface org.eclipse.jface.action.IAction |
---|
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT |
Constructor Summary | |
---|---|
protected |
SystemBaseSubMenuAction(ResourceBundle rb,
String label,
String tooltip,
ImageDescriptor image,
Shell shell)
Deprecated. use fields from resource class directly now instead of via ResourceBundle |
protected |
SystemBaseSubMenuAction(String label,
ImageDescriptor image,
Shell shell)
Constructor for SystemBaseSubMenuAction when there is just a string and image |
protected |
SystemBaseSubMenuAction(String label,
Shell shell)
Constructor for SystemBaseSubMenuAction when there is just a string |
protected |
SystemBaseSubMenuAction(String label,
String tooltip,
ImageDescriptor image,
Shell shell)
Constructor for SystemBaseSubMenuAction when there is just a string and image |
protected |
SystemBaseSubMenuAction(String label,
String tooltip,
Shell shell)
Constructor for SystemBaseSubMenuAction when there is just a string |
Method Summary | |
---|---|
protected void |
cascadeAllInputs()
Called when actions added dynamically |
protected ISystemViewMenuListener |
createMnemonicsListener(boolean setMnemonicsOnlyOnce)
Overridable method that instantiates the menu listener who job is to add mnemonics. |
protected void |
createStandardGroups(IMenuManager menu)
Creates the standard groups for the context sub-menu. |
IAction[] |
getActions()
Return the actions currently in the menu. |
IStructuredSelection |
getSelection()
Return the selection. |
Shell |
getShell()
Return the shell. |
IMenuManager |
getSubMenu()
Return the MenuManager object. |
Viewer |
getViewer()
Return the viewer. |
abstract IMenuManager |
populateSubMenu(IMenuManager menu)
Must be overridden Example of this:
menu.add(new MyAction1());
|
void |
setCreateMenuEachTime(boolean eachTime)
Call this if the submenu should be created on-the-fly every time, versus creating and populating it only on the first usage. |
void |
setEnabled(boolean enable)
Enable/disable this menu action. |
void |
setInputs(Shell shell,
Viewer v,
ISelection selection)
An optimization for performance reasons that allows all inputs to be set in one call. |
void |
setInputsFromSubMenuManager(Shell shell,
Viewer v,
ISelection selection)
Special method called by our submenu manager when from its setInputs method. |
void |
setMenuID(String Id)
Set the menu ID. |
void |
setPopulateMenuEachTime(boolean eachTime)
Call this if the submenu should be populated on-the-fly every time, versus populating it only on the first usage. |
void |
setSelection(ISelection selection)
This is called by the framework to set the selection input, just prior to showing the popup menu. |
void |
setShell(Shell shell)
Sets the parent shell for this action. |
void |
setTest(boolean testMode)
Set test mode on |
void |
setViewer(Viewer v)
This is called by the framework to set the selection input, just prior to showing the popup menu. |
Methods inherited from class org.eclipse.jface.action.AbstractAction |
---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.action.IAction |
---|
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
Field Detail |
---|
protected String actionLabel
protected String menuID
protected boolean createMenuEachTime
protected boolean populateMenuEachTime
Constructor Detail |
---|
protected SystemBaseSubMenuAction(ResourceBundle rb, String label, String tooltip, ImageDescriptor image, Shell shell)
label
- tooltip
- image
- The image to display for this actionshell
- the parent shell. If you pass null
now, be sure to call setShell(Shell)
later.protected SystemBaseSubMenuAction(String label, Shell shell)
label
- the label to display.shell
- the parent shell. If you pass null
now, be sure to call setShell(Shell)
later.protected SystemBaseSubMenuAction(String label, String tooltip, Shell shell)
label
- the label to display.tooltip
- the tooltip to display.shell
- the parent shell. If you pass null
now, be sure to call setShell(Shell)
later.protected SystemBaseSubMenuAction(String label, ImageDescriptor image, Shell shell)
label
- the label to display.image
- the image descriptor for the action.shell
- the parent shell. If you pass null
now, be sure to call setShell(Shell)
later.protected SystemBaseSubMenuAction(String label, String tooltip, ImageDescriptor image, Shell shell)
label
- the label to display.tooltip
- the tooltip to display.image
- the image descriptor for the action.shell
- the parent shell. If you pass null
now, be sure to call setShell(Shell)
later.Method Detail |
---|
public void setMenuID(String Id)
public void setCreateMenuEachTime(boolean eachTime)
public void setPopulateMenuEachTime(boolean eachTime)
public void setTest(boolean testMode)
public abstract IMenuManager populateSubMenu(IMenuManager menu)
Example of this:
menu.add(new MyAction1());
menu
- The cascading menu, which is created for you. Add your actions to it.
public IMenuManager getSubMenu()
protected void createStandardGroups(IMenuManager menu)
public IAction[] getActions()
protected ISystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce)
setMnemonicsOnlyOnce
- true if the menu is static and so mnemonics
need only be set once. False if it is dynamicpublic void setShell(Shell shell)
setShell
in interface ISystemAction
setShell
in class SystemBaseAction
public void setSelection(ISelection selection)
setSelection
in interface ISystemAction
setSelection
in class SystemBaseAction
SystemBaseAction.selectionChanged(SelectionChangedEvent event)
public void setViewer(Viewer v)
setViewer
in interface ISystemAction
setViewer
in class SystemBaseAction
public Shell getShell()
getShell
in interface ISystemAction
getShell
in class SystemBaseAction
public IStructuredSelection getSelection()
getSelection
in interface ISystemAction
getSelection
in class SystemBaseAction
public Viewer getViewer()
getViewer
in interface ISystemAction
getViewer
in class SystemBaseAction
public void setInputsFromSubMenuManager(Shell shell, Viewer v, ISelection selection)
public void setInputs(Shell shell, Viewer v, ISelection selection)
setInputs
in interface ISystemAction
setInputs
in class SystemBaseAction
protected void cascadeAllInputs()
public void setEnabled(boolean enable)
setEnabled
in interface IAction
setEnabled
in class Action
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |