Class WizardNewFolderMainPage

  • All Implemented Interfaces:
    IDialogPage, IMessageProvider, IWizardPage, Listener

    public class WizardNewFolderMainPage
    extends WizardPage
    implements Listener
    Standard main page for a wizard that creates a folder resource.

    This page may be used by clients as-is; it may be also be subclassed to suit.

    Subclasses may extend

    • handleEvent
    • Constructor Detail

      • WizardNewFolderMainPage

        public WizardNewFolderMainPage​(String pageName,
                                       IStructuredSelection selection)
        Creates a new folder creation wizard page. If the initial resource selection contains exactly one container resource then it will be used as the default container resource.
        Parameters:
        pageName - the name of the page
        selection - the current resource selection
    • Method Detail

      • createAdvancedControls

        protected void createAdvancedControls​(Composite parent)
        Creates the widget for advanced options.
        Parameters:
        parent - the parent composite
      • createControl

        public void createControl​(Composite parent)
        Description copied from interface: IDialogPage
        Creates the top level control for this dialog page under the given parent composite.

        Implementors are responsible for ensuring that the created control can be accessed via getControl

        Specified by:
        createControl in interface IDialogPage
        Parameters:
        parent - the parent composite
      • createLinkTarget

        protected void createLinkTarget()
        Creates the link target path if a link target has been specified.
      • createNewFolder

        public IFolder createNewFolder()
        Creates a new folder resource in the selected container and with the selected name. Creates any missing resource containers along the path; does nothing if the container resources already exist.

        In normal usage, this method is invoked after the user has pressed Finish on the wizard; the enablement of the Finish button implies that all controls on this page currently contain valid values.

        Note that this page caches the new folder once it has been successfully created; subsequent invocations of this method will answer the same folder resource without attempting to create it again.

        This method should be called within a workspace modify operation since it creates resources.

        Returns:
        the created folder resource, or null if the folder was not created
      • handleAdvancedButtonSelect

        protected void handleAdvancedButtonSelect()
        Shows/hides the advanced option widgets.
      • handleEvent

        public void handleEvent​(Event ev)
        The WizardNewFolderCreationPage implementation of this Listener method handles all events and enablements for controls on this page. Subclasses may extend.
        Specified by:
        handleEvent in interface Listener
        Parameters:
        ev - the event which occurred
      • initializePage

        protected void initializePage()
        Initializes this page's controls.
      • setVisible

        public void setVisible​(boolean visible)
        Description copied from class: DialogPage
        The DialogPage implementation of this IDialogPage method sets the control to the given visibility state. Subclasses may extend.
        Specified by:
        setVisible in interface IDialogPage
        Overrides:
        setVisible in class DialogPage
        Parameters:
        visible - true to make this page visible, and false to hide it
      • validateLinkedResource

        protected IStatus validateLinkedResource()
        Checks whether the linked resource target is valid. Sets the error message accordingly and returns the status.
        Returns:
        IStatus validation result from the CreateLinkedResourceGroup
      • validatePage

        protected boolean validatePage()
        Returns whether this page's controls currently all contain valid values.
        Returns:
        true if all controls are valid, and false if at least one is invalid