Package com.iizigo.handler
Class SelectionEnabler
java.lang.Object
com.iizigo.handler.SelectionEnabler
The enabler class processes selection changes from handlers, viewers, etc, and sets the state of the commands accordingly.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- booleanThe current states.- GProp<?>[]The currently selected properties as a property array, never null.The single designer property target, null when multiple are defined.The currently selected properties as a DesignerProp list, never null.
- Constructor SummaryConstructorsConstructorDescriptionCreates an instance with all disabled.- SelectionEnabler- (Shell shell, IWorkbenchPart part, ISelectionEnablerHandler selectionEnablerHandler, IPropUndoRedo undoRedo, IUndoContext undoContext, IStructuredSelection selection) Constructor.- SelectionEnabler- (IWorkbenchPart part, IStructuredSelection selection) Creates an instance for a selection synthesizing all other instanced, used for the Common Navigator and the Common Actions.
- Method SummaryModifier and TypeMethodDescription- static SelectionEnablerGets the SelectionEnabler instance from an evaluation context.Gets the selection.Gets the undo context.Gets the workbench part.- voidInvalidates this selection enabler, e.g.- void- setUndoContext- (IUndoContext undoContext) Sets the undo context.- void- update- (IStructuredSelection selection) Updates the selection.
- Field Details- isHandledpublic boolean isHandledThe current states.
- canCutpublic boolean canCutThe current states.
- canCopypublic boolean canCopyThe current states.
- canPastepublic boolean canPasteThe current states.
- canPasteBeforepublic boolean canPasteBeforeThe current states.
- canPasteAfterpublic boolean canPasteAfterThe current states.
- canPasteLinkpublic boolean canPasteLinkThe current states.
- canDeletepublic boolean canDeleteThe current states.
- canRenamepublic boolean canRenameThe current states.
- canOpenpublic boolean canOpenThe current states.
- canMovepublic boolean canMoveThe current states.
- canLinkpublic boolean canLinkThe current states.
- isNonModuleProjectpublic boolean isNonModuleProjectThe current states.
- containsModuleRootpublic boolean containsModuleRootThe current states.
- containsModuleFolderpublic boolean containsModuleFolderThe current states.
- targetsThe currently selected properties as a DesignerProp list, never null.
- propsThe currently selected properties as a property array, never null.
- targetThe single designer property target, null when multiple are defined.
 
- Constructor Details- SelectionEnablerpublic SelectionEnabler()Creates an instance with all disabled.
- SelectionEnablerCreates an instance for a selection synthesizing all other instanced, used for the Common Navigator and the Common Actions.
- SelectionEnablerpublic SelectionEnabler- (Shell shell, IWorkbenchPart part, ISelectionEnablerHandler selectionEnablerHandler, IPropUndoRedo undoRedo, IUndoContext undoContext, IStructuredSelection selection) Constructor.- Parameters:
- shell- The shell, null for none present.
- part- The workbench part, null if none is present.
- selectionEnablerHandler- The selection enabler handler, null not to use the handler.
- undoRedo- The undo/redo instance, may be null.
- undoContext- The undo context, null for workspace common undo context.
- selection- The selection.
 
 
- Method Details- getGets the SelectionEnabler instance from an evaluation context. An attempt to use a cached context is done. If not possible, get a new one.
- getSelectionGets the selection.- Returns:
- The selection or null for failure.
 
- updateUpdates the selection.
- setUndoContextSets the undo context.
- getUndoContextGets the undo context.
- getWorkbenchPartGets the workbench part.
- invalidatepublic void invalidate()Invalidates this selection enabler, e.g. when clipboard has been changed, or selection, and the requirement to call update is needed.