Package com.iizigo.vs

Class NewVSComponentWizard<TYPE extends VSComponent>

  • 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 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

      • 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:
        createPageControls in interface org.eclipse.jface.wizard.IWizard
        Overrides:
        createPageControls in class org.eclipse.jface.wizard.Wizard
      • performFinish

        public boolean performFinish()
        Finishes the wizard.
        Specified by:
        performFinish in interface org.eclipse.jface.wizard.IWizard
        Specified by:
        performFinish in class org.eclipse.jface.wizard.Wizard
      • getComponent

        public TYPE getComponent()
        Gets the created component.
      • setValueType

        public void setValueType​(Value.Type valueType)
        Sets the value type where this applies (for VS Field and VS Column Header).
        Specified by:
        setValueType in interface INewVSComponentWizardInfo
        Parameters:
        valueType - The new value type.
      • isNullAllowed

        public java.lang.Boolean isNullAllowed()
        Returns if null is allowed.
        Specified by:
        isNullAllowed in interface INewVSComponentWizardInfo
        Returns:
        null to enable user to choose, otherwise Boolean.TRUE or Boolean.FALSE to disable user choice and use this setting.
      • setRequestedName

        public void setRequestedName​(java.lang.String requestedName)
        Sets the requested name.
        Specified by:
        setRequestedName in interface INewVSComponentWizardInfo
        Parameters:
        requestedName - null if no name is requested.