|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAction
com.ibm.etools.systems.core.ui.actions.SystemBaseAction
com.ibm.etools.systems.core.ui.actions.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
|
static String |
copyright
|
protected boolean |
createMenuEachTime
|
protected String |
menuID
|
protected boolean |
populateMenuEachTime
|
protected String |
prefix
|
protected ResourceBundle |
rb
|
protected SystemSubMenuManager |
subMenu
|
Fields inherited from class com.ibm.etools.systems.core.ui.actions.SystemBaseAction |
---|
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor |
Constructor Summary | |
---|---|
protected |
SystemBaseSubMenuAction(ResourceBundle rb,
String prefix,
ImageDescriptor image,
Shell shell)
Constructor for SystemBaseSubMenuAction when there is an image |
protected |
SystemBaseSubMenuAction(ResourceBundle rb,
String prefix,
Shell shell)
Constructor for SystemBaseSubMenuAction when there is no image |
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 |
Method Summary | |
---|---|
protected void |
cascadeAllInputs()
Called when actions added dynamically |
protected SystemViewMenuListener |
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 com.ibm.etools.systems.core.ui.actions.SystemBaseAction |
---|
allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getDescription, getFirstSelection, getHelpContextId, getLabel, getNextSelection, getRemoteAdapter, getSelectionProvider, getShell, getString, getStringOrNull, getSystemConnection, getToolTip, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, run, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setSelectionProvider, setSelectionSensitive, setSystemConnection, setTracing, setTracing, updateSelection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
protected SystemSubMenuManager subMenu
protected ResourceBundle rb
protected String prefix
protected String actionLabel
protected String menuID
protected boolean createMenuEachTime
protected boolean populateMenuEachTime
Constructor Detail |
protected SystemBaseSubMenuAction(ResourceBundle rb, String prefix, ImageDescriptor image, Shell shell)
rb
- ResourceBundle containing action's label, tooltip and descriptionprefix
- The root resource bundle key to which ".label" and ".tooltip" are appendedimage
- The image to display for this actionshell
- The owning shell. If you pass null now, be sure to call setShell laterprotected SystemBaseSubMenuAction(ResourceBundle rb, String prefix, Shell shell)
rb
- ResourceBundle containing action's label, tooltip and descriptionprefix
- The root resource bundle key to which ".label" and ".tooltip" are appendedshell
- The owning shell. If you pass null now, be sure to call setShell laterprotected SystemBaseSubMenuAction(String label, Shell shell)
label
- The label to displayprotected SystemBaseSubMenuAction(String label, ImageDescriptor image, Shell shell)
label
- The label to displayMethod 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 SystemViewMenuListener 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)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |