Class WizardDataTransferPage

All Implemented Interfaces:
IDialogPage, IMessageProvider, IWizardPage, Listener, IOverwriteQuery
Direct Known Subclasses:
WizardExportResourcesPage, WizardResourceImportPage

public abstract class WizardDataTransferPage extends WizardPage implements Listener, IOverwriteQuery
The common superclass for wizard import and export pages.

This class is not intended to be subclassed outside of the workbench.

Restriction:
This class is not intended to be subclassed by clients.
  • Field Details Link icon

    • SIZING_TEXT_FIELD_WIDTH Link icon

      protected static final int SIZING_TEXT_FIELD_WIDTH
      See Also:
    • COMBO_HISTORY_LENGTH Link icon

      protected static final int COMBO_HISTORY_LENGTH
      See Also:
  • Constructor Details Link icon

    • WizardDataTransferPage Link icon

      protected WizardDataTransferPage(String pageName)
      Creates a new wizard page.
      Parameters:
      pageName - the name of the page
  • Method Details Link icon

    • addToHistory Link icon

      protected String[] addToHistory(String[] history, String newEntry)
      Adds an entry to a history, while taking care of duplicate history items and excessively long histories. The assumption is made that all histories should be of length WizardDataTransferPage.COMBO_HISTORY_LENGTH.
      Parameters:
      history - the current history
      newEntry - the entry to add to the history
    • addToHistory Link icon

      protected void addToHistory(List history, String newEntry)
      Adds an entry to a history, while taking care of duplicate history items and excessively long histories. The assumption is made that all histories should be of length WizardDataTransferPage.COMBO_HISTORY_LENGTH.
      Parameters:
      history - the current history
      newEntry - the entry to add to the history
    • allowNewContainerName Link icon

      protected abstract boolean allowNewContainerName()
      Return whether the user is allowed to enter a new container name or just choose from existing ones.

      Subclasses must implement this method.

      Returns:
      true if new ones are okay, and false if only existing ones are allowed
    • createBoldLabel Link icon

      protected Label createBoldLabel(Composite parent, String text)
      Creates a new label with a bold font.
      Parameters:
      parent - the parent control
      text - the label text
      Returns:
      the new label control
    • createOptionsGroupButtons Link icon

      protected void createOptionsGroupButtons(Group optionsGroup)
      Creates the import/export options group controls.

      The WizardDataTransferPage implementation of this method does nothing. Subclasses wishing to define such components should reimplement this hook method.

      Parameters:
      optionsGroup - the parent control
    • createPlainLabel Link icon

      protected Label createPlainLabel(Composite parent, String text)
      Creates a new label with a bold font.
      Parameters:
      parent - the parent control
      text - the label text
      Returns:
      the new label control
    • createSpacer Link icon

      protected void createSpacer(Composite parent)
      Creates a horizontal spacer line that fills the width of its container.
      Parameters:
      parent - the parent control
    • determinePageCompletion Link icon

      protected boolean determinePageCompletion()
      Returns whether this page is complete. This determination is made based upon the current contents of this page's controls. Subclasses wishing to include their controls in this determination should override the hook methods validateSourceGroup and/or validateOptionsGroup.
      Returns:
      true if this page is complete, and false if incomplete
      See Also:
    • getPathFromText Link icon

      protected IPath getPathFromText(Text textField)
      Get a path from the supplied text widget.
      Returns:
      org.eclipse.core.runtime.IPath
    • queryForContainer Link icon

      protected IPath queryForContainer(IContainer initialSelection, String msg)
      Queries the user to supply a container resource.
      Returns:
      the path to an existing or new container, or null if the user cancelled the dialog
    • queryForContainer Link icon

      protected IPath queryForContainer(IContainer initialSelection, String msg, String title)
      Queries the user to supply a container resource.
      Returns:
      the path to an existing or new container, or null if the user cancelled the dialog
    • queryOverwrite Link icon

      public String queryOverwrite(String pathString)
      The WizardDataTransfer implementation of this IOverwriteQuery method asks the user whether the existing resource at the given path should be overwritten.
      Specified by:
      queryOverwrite in interface IOverwriteQuery
      Parameters:
      pathString - desired path which might be overwritten
      Returns:
      the user's reply: one of "YES", "NO", "ALL", or "CANCEL"
    • queryYesNoQuestion Link icon

      protected boolean queryYesNoQuestion(String message)
      Displays a Yes/No question to the user with the specified message and returns the user's response.
      Parameters:
      message - the question to ask
      Returns:
      true for Yes, and false for No
    • restoreWidgetValues Link icon

      protected void restoreWidgetValues()
      Restores control settings that were saved in the previous instance of this page.

      The WizardDataTransferPage implementation of this method does nothing. Subclasses may override this hook method.

    • saveWidgetValues Link icon

      protected void saveWidgetValues()
      Saves control settings that are to be restored in the next instance of this page.

      The WizardDataTransferPage implementation of this method does nothing. Subclasses may override this hook method.

    • updatePageCompletion Link icon

      protected void updatePageCompletion()
      Determine if the page is complete and update the page appropriately.
    • updateWidgetEnablements Link icon

      protected void updateWidgetEnablements()
      Updates the enable state of this page's controls.

      The WizardDataTransferPage implementation of this method does nothing. Subclasses may extend this hook method.

    • validateDestinationGroup Link icon

      protected boolean validateDestinationGroup()
      Returns whether this page's destination specification controls currently all contain valid values.

      The WizardDataTransferPage implementation of this method returns true. Subclasses may reimplement this hook method.

      Returns:
      true indicating validity of all controls in the destination specification group
    • validateOptionsGroup Link icon

      protected boolean validateOptionsGroup()
      Returns whether this page's options group's controls currently all contain valid values.

      The WizardDataTransferPage implementation of this method returns true. Subclasses may reimplement this hook method.

      Returns:
      true indicating validity of all controls in the options group
    • validateSourceGroup Link icon

      protected boolean validateSourceGroup()
      Returns whether this page's source specification controls currently all contain valid values.

      The WizardDataTransferPage implementation of this method returns true. Subclasses may reimplement this hook method.

      Returns:
      true indicating validity of all controls in the source specification group
    • createOptionsGroup Link icon

      protected void createOptionsGroup(Composite parent)
      Create the options specification widgets.
      Parameters:
      parent - org.eclipse.swt.widgets.Composite
    • displayErrorDialog Link icon

      protected void displayErrorDialog(String message)
      Display an error dialog with the specified message.
      Parameters:
      message - the error message
    • displayErrorDialog Link icon

      protected void displayErrorDialog(Throwable exception)
      Display an error dislog with the information from the supplied exception.
      Parameters:
      exception - Throwable
    • getErrorDialogTitle Link icon

      protected String getErrorDialogTitle()
      Get the title for an error dialog. Subclasses should override.