Class ActionFactory
Most of the functionality of this class is provided by static methods and fields. Example usage:
MenuManager menu = ...; ActionFactory.IWorkbenchAction closeEditorAction = ActionFactory.CLOSE.create(window); menu.add(closeEditorAction);
Clients may declare other classes that provide additional application-specific action factories.
- Since:
- 3.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for a workbench action.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ActionFactoryWorkbench action (id: "about", commandId: "org.eclipse.ui.help.aboutAction"): Displays the About dialog.static final ActionFactoryWorkbench action (id: "activateEditor", commandId: "org.eclipse.ui.window.activateEditor"): Activate the most recently used editor.static final ActionFactoryWorkbench action (id: "back", commandId: "org.eclipse.ui.navigate.back"): Back.static final ActionFactoryWorkbench action (id: "backardHistory", commandId: "org.eclipse.ui.navigate.backwardHistory"): Backward in the navigation history.static final ActionFactoryWorkbench action (id: "close", commandId: "org.eclipse.ui.file.close"): Close the active editor.static final ActionFactoryWorkbench action (id: "closeAll", commandId: "org.eclipse.ui.file.closeAll"): Close all open editors.static final ActionFactoryWorkbench action (id: "closeAllPerspectives", commandId: "org.eclipse.ui.window.closeAllPerspectives"): Closes all perspectives.static final ActionFactoryWorkbench action (id: "closeAllSaved"): Close all open editors except those with unsaved changes.static final ActionFactoryWorkbench action (id: "closeOthers", commandId: "org.eclipse.ui.file.closeOthers"): Close all editors except the one that is active.static final ActionFactoryWorkbench action (id: "closePerspective", commandId: "org.eclipse.ui.window.closePerspective"): Closes the current perspective.static final ActionFactoryWorkbench action (id: "copy", commandId: "org.eclipse.ui.edit.copy"): Copy.static final ActionFactoryWorkbench action (id: "cut", commandId: "org.eclipse.ui.edit.cut"): Cut.static final ActionFactoryWorkbench action (id: "delete", commandId: "org.eclipse.ui.edit.delete"): Delete.static final ActionFactoryWorkbench action (id: "dynamicHelp", commandId: "org.eclipse.ui.help.dynamicHelp"): Open the dynamic help.static final ActionFactoryWorkbench action (id: "editActionSets", commandId: "org.eclipse.ui.window.customizePerspective"): Edit the action sets.static final ActionFactoryWorkbench action (id: "export", commandId: "org.eclipse.ui.file.export"): Opens the export wizard.static final ActionFactoryWorkbench action (id: "find", commandId: "org.eclipse.ui.edit.findReplace"): Find.static final ActionFactoryWorkbench action (id: "forward", commandId: "org.eclipse.ui.navigate.forward"): Forward.static final ActionFactoryWorkbench action (id: "forwardHistory", commandId: "org.eclipse.ui.navigate.forwardHistory"): Forward in the navigation history.static final ActionFactoryWorkbench action (id: "goInto", commandId: "org.eclipse.ui.navigate.goInto"): Go Into.static final ActionFactoryWorkbench action (id: "helpContents", commandId: "org.eclipse.ui.help.helpContents"): Open the help contents.static final ActionFactoryWorkbench action (id: "helpSearch", commandId: "org.eclipse.ui.help.helpSearch"): Open the help search.static final ActionFactoryWorkbench action (id: "import", commandId: "org.eclipse.ui.file.import"): Opens the import wizard.static final ActionFactoryWorkbench action (id: "intro", commandId: "org.eclipse.ui.help.quickStartAction"): Activate the introduction extension.static final ActionFactoryWorkbench action (id: "lockToolBar"): Lock/unlock the workbench window tool bar.static final ActionFactoryDeprecated.you should not use this field, kept for compatibility reasons.static final ActionFactoryDeprecated.you should not use this field, that is kept for compatibility reasons. use instead the commandorg.eclipse.ui.window.minimizePart.static final ActionFactoryWorkbench action (id: "move", commandId: "org.eclipse.ui.edit.move"): Move.static final ActionFactoryWorkbench action (id: "new", commandId: "org.eclipse.ui.newWizard"): Opens the new wizard dialog.static final ActionFactoryWorkbench action (id: "newEditor", commandId: "org.eclipse.ui.window.newEditor"): Open a new editor on the active editor's input.static final ActionFactoryWorkbench action (id: "newWizardDropDown"): Drop-down action which shows shows the new wizard drop down, or opens the new wizard dialog when pressed.static final ActionFactoryWorkbench action (id: "next", commandId: "org.eclipse.ui.navigate.next"): Next.static final ActionFactoryWorkbench action (id: "nextEditor", commandId: "org.eclipse.ui.window.nextEditor"): Next editor.static final ActionFactoryWorkbench action (id: "nextPart", commandId: "org.eclipse.ui.window.nextView"): Next part.static final ActionFactoryWorkbench action (id: "nextPerspective", commandId: "org.eclipse.ui.window.nextPerspective"): Next perspective.static final ActionFactoryWorkbench action (id: "openNewWindow", commandId: "org.eclipse.ui.window.newWindow"): Open a new workbench window.static final ActionFactoryWorkbench action (id: "openPerspectiveDialog", commandId: "org.eclipse.ui.perspectives.showPerspective"): Open the Open Perspective dialog.static final ActionFactoryWorkbench action (id: "paste", commandId: "org.eclipse.ui.edit.paste"): Paste.static final ActionFactoryWorkbench action (id: "preferences", commandId: "org.eclipse.ui.window.preferences"): Displays the Preferences dialog.static final ActionFactoryWorkbench action (id: "previous", commandId: "org.eclipse.ui.navigate.previous"): Previous.static final ActionFactoryWorkbench action (id: "previousEditor", commandId: "org.eclipse.ui.window.previousEditor"): Previous editor.static final ActionFactoryWorkbench action (id: "previousPart", commandId: "org.eclipse.ui.window.previousView"): Previous part.static final ActionFactoryWorkbench action (id: "previousPerspective", commandId: "org.eclipse.ui.window.previousPerspective"): Previous perspective.static final ActionFactoryWorkbench action (id: "print", commandId: "org.eclipse.ui.file.print"): Print.static final ActionFactoryWorkbench action (id: "properties", commandId: "org.eclipse.ui.file.properties"): Properties.static final ActionFactoryWorkbench action (id: "quit", commandId: "org.eclipse.ui.file.exit"): Quit (close the workbench).static final ActionFactoryWorkbench action (id: "redo", commandId: "org.eclipse.ui.edit.redo"): Redo.static final ActionFactoryWorkbench action (id: "refresh", commandId: "org.eclipse.ui.file.refresh"): Refresh.static final ActionFactoryWorkbench action (id: "rename", commandId: "org.eclipse.ui.edit.rename"): Rename.static final ActionFactoryWorkbench action (id: "resetPerspective", commandId: "org.eclipse.ui.window.resetPerspective"): Resets the current perspective.static final ActionFactoryWorkbench action (id: "revert", commandId: "org.eclipse.ui.file.revert"): Revert.static final ActionFactoryWorkbench action (id: "save", commandId: "org.eclipse.ui.file.save"): Save the active editor.static final ActionFactoryWorkbench action (id: "saveAll", commandId: "org.eclipse.ui.file.saveAll"): Save all open editors with unsaved changes.static final ActionFactoryWorkbench action (id: "saveAs", commandId: "org.eclipse.ui.file.saveAs"): Save As for the active editor.static final ActionFactoryWorkbench action (id: "savePerspective", commandId: "org.eclipse.ui.window.savePerspective"): Save the current perspective.static final ActionFactoryWorkbench action (id: "selectAll", commandId: "org.eclipse.ui.edit.selectAll"): Select All.static final ActionFactoryWorkbench action (id: "showEditor"): Show/hide the editor area.static final ActionFactoryWorkbench action (id: "showOpenEditors"): Show a list of open (and recently closed) editors.static final ActionFactoryWorkbench action (id: "showPartPaneMenu"): Show the part pane menu.static final ActionFactoryWorkbench action (id: "showQuickAccess"): Shows a list of UI elements like editors, views, perspectives etc.static final ActionFactoryWorkbench action (id: "showViewMenu", commandId: "org.eclipse.ui.window.showViewMenu"): Show the view menu.static final ActionFactoryWorkbench action (id: "showWorkbookEditors"): Shows a list of open editors in the current or last active workbook.static final ActionFactoryWorkbench action (id: "toggleCoolbar"): Toggle the visibility of the coolbar and perspective switcher.static final ActionFactoryWorkbench action (id: "undo", commandId: "org.eclipse.ui.edit.undo"): Undo.static final ActionFactoryWorkbench action (id: "up", commandId: "org.eclipse.ui.navigate.up"): Up.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedActionFactory(String actionId) Creates a new workbench action factory with the given id.protectedActionFactory(String actionId, String commandId) Create a new workbench action factory with the given IDs.
- 
Method SummaryModifier and TypeMethodDescriptionabstract ActionFactory.IWorkbenchActioncreate(IWorkbenchWindow window) Creates a new standard action for the given workbench window.Return the command id of this action factory.getId()Returns the id of this action factory.static voidEstablishes bi-direction connections between the forward and backward actions of a cycle pair.
- 
Field Details- 
ABOUTWorkbench action (id: "about", commandId: "org.eclipse.ui.help.aboutAction"): Displays the About dialog. This action maintains its enablement state.
- 
ACTIVATE_EDITORWorkbench action (id: "activateEditor", commandId: "org.eclipse.ui.window.activateEditor"): Activate the most recently used editor. This action maintains its enablement state.
- 
BACKWorkbench action (id: "back", commandId: "org.eclipse.ui.navigate.back"): Back. This action is aRetargetActionwith id "back". This action maintains its enablement state.
- 
BACKWARD_HISTORYWorkbench action (id: "backardHistory", commandId: "org.eclipse.ui.navigate.backwardHistory"): Backward in the navigation history. This action maintains its enablement state.
- 
CLOSEWorkbench action (id: "close", commandId: "org.eclipse.ui.file.close"): Close the active editor. This action maintains its enablement state.
- 
CLOSE_ALLWorkbench action (id: "closeAll", commandId: "org.eclipse.ui.file.closeAll"): Close all open editors. This action maintains its enablement state.
- 
CLOSE_OTHERSWorkbench action (id: "closeOthers", commandId: "org.eclipse.ui.file.closeOthers"): Close all editors except the one that is active. This action maintains its enablement state.- Since:
- 3.2
 
- 
CLOSE_ALL_PERSPECTIVESWorkbench action (id: "closeAllPerspectives", commandId: "org.eclipse.ui.window.closeAllPerspectives"): Closes all perspectives. This action maintains its enablement state.
- 
CLOSE_ALL_SAVEDWorkbench action (id: "closeAllSaved"): Close all open editors except those with unsaved changes. This action maintains its enablement state.
- 
CLOSE_PERSPECTIVEWorkbench action (id: "closePerspective", commandId: "org.eclipse.ui.window.closePerspective"): Closes the current perspective. This action maintains its enablement state.
- 
INTROWorkbench action (id: "intro", commandId: "org.eclipse.ui.help.quickStartAction"): Activate the introduction extension. This action should not be instantiated if no intro is provided. Use code like:if (window.getWorkbench().getIntroManager().hasIntro()) { introAction = ActionFactory.INTRO.create(window); register(introAction); }
- 
COPYWorkbench action (id: "copy", commandId: "org.eclipse.ui.edit.copy"): Copy. This action is aRetargetActionwith id "copy". This action maintains its enablement state.
- 
CUTWorkbench action (id: "cut", commandId: "org.eclipse.ui.edit.cut"): Cut. This action is aRetargetActionwith id "cut". This action maintains its enablement state.
- 
DELETEWorkbench action (id: "delete", commandId: "org.eclipse.ui.edit.delete"): Delete. This action is aRetargetActionwith id "delete". This action maintains its enablement state.
- 
EDIT_ACTION_SETSWorkbench action (id: "editActionSets", commandId: "org.eclipse.ui.window.customizePerspective"): Edit the action sets. This action maintains its enablement state.
- 
EXPORTWorkbench action (id: "export", commandId: "org.eclipse.ui.file.export"): Opens the export wizard. This action maintains its enablement state.
- 
FINDWorkbench action (id: "find", commandId: "org.eclipse.ui.edit.findReplace"): Find. This action is aRetargetActionwith id "find". This action maintains its enablement state.
- 
FORWARDWorkbench action (id: "forward", commandId: "org.eclipse.ui.navigate.forward"): Forward. This action is aRetargetActionwith id "forward". This action maintains its enablement state.
- 
FORWARD_HISTORYWorkbench action (id: "forwardHistory", commandId: "org.eclipse.ui.navigate.forwardHistory"): Forward in the navigation history. This action maintains its enablement state.
- 
GO_INTOWorkbench action (id: "goInto", commandId: "org.eclipse.ui.navigate.goInto"): Go Into. This action is aRetargetActionwith id "goInto". This action maintains its enablement state.
- 
IMPORTWorkbench action (id: "import", commandId: "org.eclipse.ui.file.import"): Opens the import wizard. This action maintains its enablement state.
- 
LOCK_TOOL_BARWorkbench action (id: "lockToolBar"): Lock/unlock the workbench window tool bar. This action maintains its enablement state.
- 
MAXIMIZEDeprecated.you should not use this field, kept for compatibility reasons. use instead the commandorg.eclipse.ui.window.maximizePart.Workbench action (id: "maximize", commandId: "org.eclipse.ui.window.maximizePart"): Maximize/restore the active part. This action maintains its enablement state.
- 
MINIMIZEDeprecated.you should not use this field, that is kept for compatibility reasons. use instead the commandorg.eclipse.ui.window.minimizePart.Workbench action (id: "minimize", commandId: "org.eclipse.ui.window.minimizePart"): Minimizes the active part. This action maintains its enablement state.- Since:
- 3.1
 
- 
MOVEWorkbench action (id: "move", commandId: "org.eclipse.ui.edit.move"): Move. This action is aRetargetActionwith id "move". This action maintains its enablement state.
- 
NEWWorkbench action (id: "new", commandId: "org.eclipse.ui.newWizard"): Opens the new wizard dialog. This action maintains its enablement state.
- 
NEW_WIZARD_DROP_DOWNWorkbench action (id: "newWizardDropDown"): Drop-down action which shows shows the new wizard drop down, or opens the new wizard dialog when pressed. For use in the toolbar. This action maintains its enablement state.- Since:
- 3.1
 
- 
NEXTWorkbench action (id: "next", commandId: "org.eclipse.ui.navigate.next"): Next. This action is aRetargetActionwith id "next". This action maintains its enablement state.
- 
NEXT_EDITORWorkbench action (id: "nextEditor", commandId: "org.eclipse.ui.window.nextEditor"): Next editor. This action maintains its enablement state.NEXT_EDITORandPREVIOUS_EDITORform a cycle action pair. For a given window, useActionFactory.linkCycleActionPairto connect the two.
- 
NEXT_PARTWorkbench action (id: "nextPart", commandId: "org.eclipse.ui.window.nextView"): Next part. This action maintains its enablement state.NEXT_PARTandPREVIOUS_PARTform a cycle action pair. For a given window, useActionFactory.linkCycleActionPairto connect the two.
- 
NEXT_PERSPECTIVEWorkbench action (id: "nextPerspective", commandId: "org.eclipse.ui.window.nextPerspective"): Next perspective. This action maintains its enablement state.NEXT_PERSPECTIVEandPREVIOUS_PERSPECTIVEform a cycle action pair. For a given window, useActionFactory.linkCycleActionPairto connect the two.
- 
OPEN_NEW_WINDOWWorkbench action (id: "openNewWindow", commandId: "org.eclipse.ui.window.newWindow"): Open a new workbench window. This action maintains its enablement state.
- 
PASTEWorkbench action (id: "paste", commandId: "org.eclipse.ui.edit.paste"): Paste. This action is aRetargetActionwith id "paste". This action maintains its enablement state.
- 
PREFERENCESWorkbench action (id: "preferences", commandId: "org.eclipse.ui.window.preferences"): Displays the Preferences dialog. This action maintains its enablement state.
- 
PREVIOUSWorkbench action (id: "previous", commandId: "org.eclipse.ui.navigate.previous"): Previous. This action is aRetargetActionwith id "previous". This action maintains its enablement state.
- 
PREVIOUS_EDITORWorkbench action (id: "previousEditor", commandId: "org.eclipse.ui.window.previousEditor"): Previous editor. This action maintains its enablement state.NEXT_EDITORandPREVIOUS_EDITORform a cycle action pair. For a given window, useActionFactory.linkCycleActionPairto connect the two.
- 
PREVIOUS_PARTWorkbench action (id: "previousPart", commandId: "org.eclipse.ui.window.previousView"): Previous part. This action maintains its enablement state.NEXT_PARTandPREVIOUS_PARTform a cycle action pair. For a given window, useActionFactory.linkCycleActionPairto connect the two.
- 
PREVIOUS_PERSPECTIVEWorkbench action (id: "previousPerspective", commandId: "org.eclipse.ui.window.previousPerspective"): Previous perspective. This action maintains its enablement state.NEXT_PERSPECTIVEandPREVIOUS_PERSPECTIVEform a cycle action pair. For a given window, useActionFactory.linkCycleActionPairto connect the two.
- 
PRINTWorkbench action (id: "print", commandId: "org.eclipse.ui.file.print"): Print. This action is aRetargetActionwith id "print". This action maintains its enablement state.
- 
PROPERTIESWorkbench action (id: "properties", commandId: "org.eclipse.ui.file.properties"): Properties. This action is aRetargetActionwith id "properties". This action maintains its enablement state.
- 
QUITWorkbench action (id: "quit", commandId: "org.eclipse.ui.file.exit"): Quit (close the workbench). This action maintains its enablement state.
- 
REDOWorkbench action (id: "redo", commandId: "org.eclipse.ui.edit.redo"): Redo. This action is aRetargetActionwith id "redo". This action maintains its enablement state.
- 
REFRESHWorkbench action (id: "refresh", commandId: "org.eclipse.ui.file.refresh"): Refresh. This action is aRetargetActionwith id "refresh". This action maintains its enablement state.
- 
RENAMEWorkbench action (id: "rename", commandId: "org.eclipse.ui.edit.rename"): Rename. This action is aRetargetActionwith id "rename". This action maintains its enablement state.
- 
RESET_PERSPECTIVEWorkbench action (id: "resetPerspective", commandId: "org.eclipse.ui.window.resetPerspective"): Resets the current perspective. This action maintains its enablement state.
- 
REVERTWorkbench action (id: "revert", commandId: "org.eclipse.ui.file.revert"): Revert. This action is aRetargetActionwith id "revert". This action maintains its enablement state.
- 
SAVEWorkbench action (id: "save", commandId: "org.eclipse.ui.file.save"): Save the active editor. This action maintains its enablement state.
- 
SAVE_ALLWorkbench action (id: "saveAll", commandId: "org.eclipse.ui.file.saveAll"): Save all open editors with unsaved changes. This action maintains its enablement state.
- 
SAVE_ASWorkbench action (id: "saveAs", commandId: "org.eclipse.ui.file.saveAs"): Save As for the active editor. This action maintains its enablement state.
- 
SAVE_PERSPECTIVEWorkbench action (id: "savePerspective", commandId: "org.eclipse.ui.window.savePerspective"): Save the current perspective. This action maintains its enablement state.
- 
SELECT_ALLWorkbench action (id: "selectAll", commandId: "org.eclipse.ui.edit.selectAll"): Select All. This action is aRetargetActionwith id "selectAll". This action maintains its enablement state.
- 
SHOW_EDITORWorkbench action (id: "showEditor"): Show/hide the editor area. This action maintains its enablement state.
- 
SHOW_OPEN_EDITORSWorkbench action (id: "showOpenEditors"): Show a list of open (and recently closed) editors. This action maintains its enablement state.
- 
SHOW_WORKBOOK_EDITORSWorkbench action (id: "showWorkbookEditors"): Shows a list of open editors in the current or last active workbook.
- 
SHOW_QUICK_ACCESSWorkbench action (id: "showQuickAccess"): Shows a list of UI elements like editors, views, perspectives etc.- Since:
- 3.3
 
- 
SHOW_PART_PANE_MENUWorkbench action (id: "showPartPaneMenu"): Show the part pane menu. This action maintains its enablement state.
- 
SHOW_VIEW_MENUWorkbench action (id: "showViewMenu", commandId: "org.eclipse.ui.window.showViewMenu"): Show the view menu. This action maintains its enablement state.
- 
UNDOWorkbench action (id: "undo", commandId: "org.eclipse.ui.edit.undo"): Undo. This action is aRetargetActionwith id "undo". This action maintains its enablement state.
- 
UPWorkbench action (id: "up", commandId: "org.eclipse.ui.navigate.up"): Up. This action is aRetargetActionwith id "up". This action maintains its enablement state.
- 
HELP_CONTENTSWorkbench action (id: "helpContents", commandId: "org.eclipse.ui.help.helpContents"): Open the help contents. This action is always enabled.
- 
HELP_SEARCHWorkbench action (id: "helpSearch", commandId: "org.eclipse.ui.help.helpSearch"): Open the help search. This action is always enabled.- Since:
- 3.1
 
- 
DYNAMIC_HELPWorkbench action (id: "dynamicHelp", commandId: "org.eclipse.ui.help.dynamicHelp"): Open the dynamic help. This action is always enabled.- Since:
- 3.1
 
- 
OPEN_PERSPECTIVE_DIALOGWorkbench action (id: "openPerspectiveDialog", commandId: "org.eclipse.ui.perspectives.showPerspective"): Open the Open Perspective dialog. This action is always enabled.- Since:
- 3.1
 
- 
NEW_EDITORWorkbench action (id: "newEditor", commandId: "org.eclipse.ui.window.newEditor"): Open a new editor on the active editor's input. This action maintains its enablement state.- Since:
- 3.1
 
- 
TOGGLE_COOLBARWorkbench action (id: "toggleCoolbar"): Toggle the visibility of the coolbar and perspective switcher. This will only enable visibility of the coolbar and perspective bar if the window advisor creating the window allowed for their visibility initially.- Since:
- 3.3
 
 
- 
- 
Constructor Details- 
ActionFactoryCreates a new workbench action factory with the given id.- Parameters:
- actionId- the id of actions created by this action factory
 
- 
ActionFactoryCreate a new workbench action factory with the given IDs.- Parameters:
- actionId- the id of actions created by this action factory
- commandId- the matching command id
- Since:
- 3.5
 
 
- 
- 
Method Details- 
linkCycleActionPairpublic static void linkCycleActionPair(ActionFactory.IWorkbenchAction next, ActionFactory.IWorkbenchAction previous) Establishes bi-direction connections between the forward and backward actions of a cycle pair.Example usage: ActionFactory.IWorkbenchAction nextEditorAction = ActionFactory.NEXT_EDITOR.create(window); ActionFactory.IWorkbenchAction previousEditorAction = ActionFactory.PREVIOUS_EDITOR.create(window); ActionFactory.linkCycleActionPair(nextEditorAction, previousEditorAction); - Parameters:
- next- the action that moves forward
- previous- the action that moves backward
 
- 
createCreates a new standard action for the given workbench window. The action has an id as specified by the particular factory.Actions automatically register listeners against the workbench window so that they can keep their enablement state up to date. Ordinarily, the window's references to these listeners will be dropped automatically when the window closes. However, if the client needs to get rid of an action while the window is still open, the client must call disposeto give the action an opportunity to deregister its listeners and to perform any other cleanup.- Parameters:
- window- the workbench window
- Returns:
- the workbench action
 
- 
getIdReturns the id of this action factory.- Returns:
- the id of actions created by this action factory
 
- 
getCommandIdReturn the command id of this action factory.- Returns:
- the command id of the action created by this action factory. May be
         null.
- Since:
- 3.5
 
 
-