Package com.iizigo.vs
Class NewVSComponentWizard<TYPE extends VSComponent>
- java.lang.Object
- org.eclipse.jface.wizard.Wizard
- com.iizigo.vs.NewVSComponentWizard<TYPE>
- All Implemented Interfaces:
INewVSComponentWizardInfo,org.eclipse.jface.window.IShellProvider,org.eclipse.jface.wizard.IWizard
public class NewVSComponentWizard<TYPE extends VSComponent> extends org.eclipse.jface.wizard.Wizard implements INewVSComponentWizardInfo
New VS Component wizard.- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description NewVSComponentWizard(int createType, java.lang.String title, EditorVirtualSpace virtualSpace, Value.Type type, boolean isChooseTypeAllowed, java.lang.Boolean isNullAllowed, boolean doCreateDefaultValue, VSReferenceOwnerData<VSTable,VSTableReference> tableOwner, IPropUndoRedo undoRedo)Constructor.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreatePageControls(org.eclipse.swt.widgets.Composite pageContainer)Creation: override to set image on shell.booleandoCreateDefaultValue()Returns if a default value should be created.TYPEgetComponent()Gets the created component.java.lang.StringgetRequestedName()Gets the requested name.VSReferenceOwnerData<VSTable,VSTableReference>getTableOwner()Gets the table owner, for table column creation.IPropUndoRedogetUndoRedo()Gets the undo/redo instance.Value.TypegetValueType()Returns the value type where this applies (for VS Field and VS Column Header).EditorVirtualSpacegetVirtualSpace()Returns the VirtualSpace.booleanisChooseTypeAllowed()Returns if the user is allowed to choose type.java.lang.BooleanisNullAllowed()Returns if null is allowed.static NewVSComponentWizard<EditorVSAction>newVSActionWizard(EditorVirtualSpace virtualSpace, IPropUndoRedo undoRedo)Create a new instance of the wizard to create an action.static NewVSComponentWizard<EditorVSField>newVSFieldWizard(EditorVirtualSpace virtualSpace, Value.Type type, boolean isChooseTypeAllowed, java.lang.Boolean isNullAllowed, boolean doCreateDefaultValue, IPropUndoRedo undoRedo)Create a new instance of the wizard to create a field.static NewVSComponentWizard<EditorVSColumnHeader>newVSTableColumnWizard(EditorVirtualSpace virtualSpace, Value.Type type, boolean isChooseTypeAllowed, java.lang.Boolean isNullAllowed, boolean doCreateDefaultValue, VSReferenceOwnerData<VSTable,VSTableReference> tableOwner, IPropUndoRedo undoRedo)Create a new instance of the wizard to create a field or a table column.static NewVSComponentWizard<EditorVSTable>newVSTableWizard(EditorVirtualSpace virtualSpace, VSReferenceOwnerData<VSTable,VSTableReference> tableOwner, IPropUndoRedo undoRedo)Create a new instance of the wizard to create a table.booleanperformFinish()Finishes the wizard.voidsetNullAllowed(boolean isNullAllowed)Sets the null allowed flag.voidsetRequestedName(java.lang.String requestedName)Sets the requested name.voidsetValueType(Value.Type valueType)Sets the value type where this applies (for VS Field and VS Column Header).Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, addPages, canFinish, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.iizigo.vs.INewVSComponentWizardInfo
getDescription, getTitle, isComponentSelectable, registerRequestedNameListener
Constructor Detail
NewVSComponentWizard
public NewVSComponentWizard(int createType, java.lang.String title, EditorVirtualSpace virtualSpace, Value.Type type, boolean isChooseTypeAllowed, java.lang.Boolean isNullAllowed, boolean doCreateDefaultValue, VSReferenceOwnerData<VSTable,VSTableReference> tableOwner, IPropUndoRedo undoRedo)Constructor.- Parameters:
createType- Creation type, or -1 not to.title- The window title and for undo operation.virtualSpace- The VirtualSpace.type- Value type for column & field.isChooseTypeAllowed- Flag indicating user is allowed to choose type (for field and column).isNullAllowed- Flag to allow null for column & field, specify null to let user choose.doCreateDefaultValue- Flag to create a default value, event when null is allowed or chosen.tableOwner- The table owner, when possible to create table for a column that doesn't exist.undoRedo- Undo/redo instance.
Method Detail
newVSActionWizard
public static NewVSComponentWizard<EditorVSAction> newVSActionWizard(EditorVirtualSpace virtualSpace, IPropUndoRedo undoRedo)
Create a new instance of the wizard to create an action.- Parameters:
virtualSpace- The VirtualSpace.undoRedo- Undo/redo instance.- Returns:
- The new component wizard.
newVSTableWizard
public static NewVSComponentWizard<EditorVSTable> newVSTableWizard(EditorVirtualSpace virtualSpace, VSReferenceOwnerData<VSTable,VSTableReference> tableOwner, IPropUndoRedo undoRedo)
Create a new instance of the wizard to create a table.- Parameters:
virtualSpace- The VirtualSpace.tableOwner- The table owner, when possible to create table for a column that doesn't exist.undoRedo- Undo/redo instance.- Returns:
- The new component wizard.
newVSFieldWizard
public static NewVSComponentWizard<EditorVSField> newVSFieldWizard(EditorVirtualSpace virtualSpace, Value.Type type, boolean isChooseTypeAllowed, java.lang.Boolean isNullAllowed, boolean doCreateDefaultValue, IPropUndoRedo undoRedo)
Create a new instance of the wizard to create a field.- Parameters:
virtualSpace- The VirtualSpace.type- Value type for column & field.isChooseTypeAllowed- Flag indicating user is allowed to choose type (for field and column).isNullAllowed- Flag to allow null for column & field, specify null to let user choose.doCreateDefaultValue- Flag to create a default value, event when null is allowed or chosen.undoRedo- Undo/redo instance.- Returns:
- The new component wizard.
newVSTableColumnWizard
public static NewVSComponentWizard<EditorVSColumnHeader> newVSTableColumnWizard(EditorVirtualSpace virtualSpace, Value.Type type, boolean isChooseTypeAllowed, java.lang.Boolean isNullAllowed, boolean doCreateDefaultValue, VSReferenceOwnerData<VSTable,VSTableReference> tableOwner, IPropUndoRedo undoRedo)
Create a new instance of the wizard to create a field or a table column.- Parameters:
virtualSpace- The VirtualSpace.type- Value type for column & field.isChooseTypeAllowed- Flag indicating user is allowed to choose type (for field and column).isNullAllowed- Flag to allow null for column & field, specify null to let user choose.doCreateDefaultValue- Flag to create a default value, event when null is allowed or chosen.tableOwner- The table owner, when possible to create table for a column that doesn't exist.undoRedo- Undo/redo instance.- Returns:
- The new component wizard.
createPageControls
public void createPageControls(org.eclipse.swt.widgets.Composite pageContainer)
Creation: override to set image on shell.- Specified by:
createPageControlsin interfaceorg.eclipse.jface.wizard.IWizard- Overrides:
createPageControlsin classorg.eclipse.jface.wizard.Wizard
performFinish
public boolean performFinish()
Finishes the wizard.- Specified by:
performFinishin interfaceorg.eclipse.jface.wizard.IWizard- Specified by:
performFinishin classorg.eclipse.jface.wizard.Wizard
getComponent
public TYPE getComponent()
Gets the created component.
getVirtualSpace
public EditorVirtualSpace getVirtualSpace()
Returns the VirtualSpace.- Specified by:
getVirtualSpacein interfaceINewVSComponentWizardInfo
getValueType
public Value.Type getValueType()
Returns the value type where this applies (for VS Field and VS Column Header).- Specified by:
getValueTypein interfaceINewVSComponentWizardInfo
setValueType
public void setValueType(Value.Type valueType)
Sets the value type where this applies (for VS Field and VS Column Header).- Specified by:
setValueTypein interfaceINewVSComponentWizardInfo- Parameters:
valueType- The new value type.
isChooseTypeAllowed
public boolean isChooseTypeAllowed()
Returns if the user is allowed to choose type.- Specified by:
isChooseTypeAllowedin interfaceINewVSComponentWizardInfo
isNullAllowed
public java.lang.Boolean isNullAllowed()
Returns if null is allowed.- Specified by:
isNullAllowedin interfaceINewVSComponentWizardInfo- Returns:
- null to enable user to choose, otherwise Boolean.TRUE or Boolean.FALSE to disable user choice and use this setting.
setNullAllowed
public void setNullAllowed(boolean isNullAllowed)
Sets the null allowed flag.- Specified by:
setNullAllowedin interfaceINewVSComponentWizardInfo
doCreateDefaultValue
public boolean doCreateDefaultValue()
Returns if a default value should be created.- Specified by:
doCreateDefaultValuein interfaceINewVSComponentWizardInfo
getTableOwner
public VSReferenceOwnerData<VSTable,VSTableReference> getTableOwner()
Gets the table owner, for table column creation.- Specified by:
getTableOwnerin interfaceINewVSComponentWizardInfo- Returns:
- The table owner, or null for not available (or not applicable).
getUndoRedo
public IPropUndoRedo getUndoRedo()
Gets the undo/redo instance.- Specified by:
getUndoRedoin interfaceINewVSComponentWizardInfo
getRequestedName
public java.lang.String getRequestedName()
Gets the requested name.- Specified by:
getRequestedNamein interfaceINewVSComponentWizardInfo- Returns:
- null if no name is requested.
setRequestedName
public void setRequestedName(java.lang.String requestedName)
Sets the requested name.- Specified by:
setRequestedNamein interfaceINewVSComponentWizardInfo- Parameters:
requestedName- null if no name is requested.