Package com.iizigo.prop
Class StandaloneEditorController
- java.lang.Object
- com.iizigo.prop.StandaloneEditorController
- All Implemented Interfaces:
IPropertyEditorController
public class StandaloneEditorController extends java.lang.Object implements IPropertyEditorController
A stand-alone editor controller that can be used for the Property Editor.- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description StandaloneEditorController(org.eclipse.swt.widgets.Shell shell, ModuleModel model)Constructor.StandaloneEditorController(org.eclipse.swt.widgets.Shell shell, ModuleModel model, org.eclipse.core.commands.operations.IUndoContext undoContext, java.lang.Runnable updateStates, IPropUndoRedo undoRedo, MultiSelectionProvider multiSelectionProvider)Constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModuleModelgetModuleModel()Gets the ModuleModel instance of the project.MultiSelectionProvidergetMultiSelectionProvider()Gets the multi-property selection provider.java.lang.ObjectgetUndoContext()Gets the undo context.IPropUndoRedogetUndoRedo()Gets the undo/redo interface.booleanisDisposed()Checks for disposal.voidremovePropertyValue(GProp<?> property)Removes a property when undefined in the editors.voidsetBlockViewerFocus(boolean block)Blocks the target viewer from focus.voidsetPropertyAttrFlag(GProp<?> property, int attr, boolean flag)Sets a property attribute flag.voidsetPropertyError(GProp<?> property, java.lang.String errorID, IPropErrorItem item)Sets a property error.voidsetPropertyValue(PropCnr parent, GProp<?> property, java.lang.Object value)Sets a property value.
Constructor Detail
StandaloneEditorController
public StandaloneEditorController(org.eclipse.swt.widgets.Shell shell, ModuleModel model)Constructor.- Parameters:
shell- The shell.model- The Module model.
StandaloneEditorController
public StandaloneEditorController(org.eclipse.swt.widgets.Shell shell, ModuleModel model, org.eclipse.core.commands.operations.IUndoContext undoContext, java.lang.Runnable updateStates, IPropUndoRedo undoRedo, MultiSelectionProvider multiSelectionProvider)Constructor.- Parameters:
shell- The shell.model- The Module model.undoContext- The undo context to use, null for none.updateStates- Runnable called when states needs to update, null for none.undoRedo- Undo/redo instance, null to create one in the stand-alone controller.multiSelectionProvider- The MultiSelectionProvider instance, null to create one in the stand-alone controller.
Method Detail
getUndoContext
public java.lang.Object getUndoContext()
Gets the undo context.- Specified by:
getUndoContextin interfaceIPropertyEditorController- Returns:
- An object castable to org.eclipse.core.commands.operations.IUndoContext.
getModuleModel
public ModuleModel getModuleModel()
Gets the ModuleModel instance of the project.- Specified by:
getModuleModelin interfaceIPropertyEditorController
getMultiSelectionProvider
public MultiSelectionProvider getMultiSelectionProvider()
Gets the multi-property selection provider.- Specified by:
getMultiSelectionProviderin interfaceIPropertyEditorController
getUndoRedo
public IPropUndoRedo getUndoRedo()
Gets the undo/redo interface.- Specified by:
getUndoRedoin interfaceIPropertyEditorController
setBlockViewerFocus
public void setBlockViewerFocus(boolean block)
Blocks the target viewer from focus.- Specified by:
setBlockViewerFocusin interfaceIPropertyEditorController
isDisposed
public boolean isDisposed()
Checks for disposal.- Specified by:
isDisposedin interfaceIPropertyEditorController
setPropertyError
public void setPropertyError(GProp<?> property, java.lang.String errorID, IPropErrorItem item)
Sets a property error. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
setPropertyErrorin interfaceIPropertyEditorController
removePropertyValue
public void removePropertyValue(GProp<?> property)
Removes a property when undefined in the editors. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
removePropertyValuein interfaceIPropertyEditorController
setPropertyAttrFlag
public void setPropertyAttrFlag(GProp<?> property, int attr, boolean flag)
Sets a property attribute flag. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
setPropertyAttrFlagin interfaceIPropertyEditorController
setPropertyValue
public void setPropertyValue(PropCnr parent, GProp<?> property, java.lang.Object value)
Sets a property value. The undo/redo functionality will wrap an undo/redo action for this function. This method handles setting a property value that is extended in the parent and the new property is to replace it in the parent.- Specified by:
setPropertyValuein interfaceIPropertyEditorController