Package com.iizigo.handler
Class SelectionEnabler
- java.lang.Object
- com.iizigo.handler.SelectionEnabler
 
- public class SelectionEnabler extends java.lang.ObjectThe enabler class processes selection changes from handlers, viewers, etc, and sets the state of the commands accordingly.- Author:
- Christopher Mindus
 
- Field Summary- Fields - Modifier and Type - Field - Description - boolean- canCopyThe current states.- boolean- canCutThe current states.- boolean- canDeleteThe current states.- boolean- canLinkThe current states.- boolean- canMoveThe current states.- boolean- canOpenThe current states.- boolean- canPasteThe current states.- boolean- canPasteAfterThe current states.- boolean- canPasteBeforeThe current states.- boolean- canPasteLinkThe current states.- boolean- canRenameThe current states.- boolean- containsModuleFolderThe current states.- boolean- containsModuleRootThe current states.- boolean- isHandledThe current states.- boolean- isNonModuleProjectThe current states.- GProp<?>[]- propsThe currently selected properties as a property array, never null.- DesignerProp- targetThe single designer property target, null when multiple are defined.- java.util.ArrayList<DesignerProp>- targetsThe currently selected properties as a DesignerProp list, never null.
 - Constructor Summary- Constructors - Constructor - Description - SelectionEnabler()Creates an instance with all disabled.- SelectionEnabler(org.eclipse.swt.widgets.Shell shell, org.eclipse.ui.IWorkbenchPart part, ISelectionEnablerHandler selectionEnablerHandler, IPropUndoRedo undoRedo, org.eclipse.core.commands.operations.IUndoContext undoContext, org.eclipse.jface.viewers.IStructuredSelection selection)Constructor.- SelectionEnabler(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.IStructuredSelection selection)Creates an instance for a selection synthesizing all other instanced, used for the Common Navigator and the Common Actions.
 - Method Summary- All Methods Static Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - static SelectionEnabler- get(java.lang.Object evaluationContext)Gets the SelectionEnabler instance from an evaluation context.- org.eclipse.jface.viewers.IStructuredSelection- getSelection()Gets the selection.- org.eclipse.core.commands.operations.IUndoContext- getUndoContext()Gets the undo context.- org.eclipse.ui.IWorkbenchPart- getWorkbenchPart()Gets the workbench part.- void- invalidate()Invalidates this selection enabler, e.g.- void- setUndoContext(org.eclipse.core.commands.operations.IUndoContext undoContext)Sets the undo context.- void- update(org.eclipse.jface.viewers.IStructuredSelection selection)Updates the selection.
 
- Field Detail- isHandled- public boolean isHandled The current states.
 - canCut- public boolean canCut The current states.
 - canCopy- public boolean canCopy The current states.
 - canPaste- public boolean canPaste The current states.
 - canPasteBefore- public boolean canPasteBefore The current states.
 - canPasteAfter- public boolean canPasteAfter The current states.
 - canPasteLink- public boolean canPasteLink The current states.
 - canDelete- public boolean canDelete The current states.
 - canRename- public boolean canRename The current states.
 - canOpen- public boolean canOpen The current states.
 - canMove- public boolean canMove The current states.
 - canLink- public boolean canLink The current states.
 - isNonModuleProject- public boolean isNonModuleProject The current states.
 - containsModuleRoot- public boolean containsModuleRoot The current states.
 - containsModuleFolder- public boolean containsModuleFolder The current states.
 - targets- public java.util.ArrayList<DesignerProp> targets The currently selected properties as a DesignerProp list, never null.
 - props- public GProp<?>[] props The currently selected properties as a property array, never null.
 - target- public DesignerProp target The single designer property target, null when multiple are defined.
 
 - Constructor Detail- SelectionEnabler- public SelectionEnabler() Creates an instance with all disabled.
 - SelectionEnabler- public SelectionEnabler(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.IStructuredSelection selection)Creates an instance for a selection synthesizing all other instanced, used for the Common Navigator and the Common Actions.
 - SelectionEnabler- public SelectionEnabler(org.eclipse.swt.widgets.Shell shell, org.eclipse.ui.IWorkbenchPart part, ISelectionEnablerHandler selectionEnablerHandler, IPropUndoRedo undoRedo, org.eclipse.core.commands.operations.IUndoContext undoContext, org.eclipse.jface.viewers.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 Detail- get- public static SelectionEnabler get(java.lang.Object evaluationContext) Gets the SelectionEnabler instance from an evaluation context. An attempt to use a cached context is done. If not possible, get a new one.
 - getSelection- public org.eclipse.jface.viewers.IStructuredSelection getSelection() Gets the selection.- Returns:
- The selection or null for failure.
 
 - update- public void update(org.eclipse.jface.viewers.IStructuredSelection selection) Updates the selection.
 - setUndoContext- public void setUndoContext(org.eclipse.core.commands.operations.IUndoContext undoContext) Sets the undo context.
 - getUndoContext- public org.eclipse.core.commands.operations.IUndoContext getUndoContext() Gets the undo context.
 - getWorkbenchPart- public org.eclipse.ui.IWorkbenchPart getWorkbenchPart() Gets the workbench part.
 - invalidate- public void invalidate() Invalidates this selection enabler, e.g. when clipboard has been changed, or selection, and the requirement to call update is needed.