Class WizardExportResourcesPage

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

public abstract class WizardExportResourcesPage extends WizardDataTransferPage
Abstract superclass for a typical export wizard's main page.

Clients may subclass this page to inherit its common destination resource selection facilities.

Subclasses must implement

  • createDestinationGroup

Subclasses may override

  • allowNewContainerName

Subclasses may extend

  • handleEvent
  • internalSaveWidgetValues
  • updateWidgetEnablements
  • Constructor Details

  • Method Details

    • allowNewContainerName

      protected boolean allowNewContainerName()
      The addToHierarchyToCheckedStore implementation of this WizardDataTransferPage method returns false. Subclasses may override this method.
      Specified by:
      allowNewContainerName in class WizardDataTransferPage
      Returns:
      true if new ones are okay, and false if only existing ones are allowed
    • createButton

      protected Button createButton(Composite parent, int id, String label, boolean defaultButton)
      Creates a new button with the given id.

      The Dialog implementation of this framework method creates a standard push button, registers for selection events including button presses and registers default buttons with its shell. The button id is stored as the buttons client data. Note that the parent's layout is assumed to be a GridLayout and the number of columns in this layout is incremented. Subclasses may override.

      Parameters:
      parent - the parent composite
      id - the id of the button (see IDialogConstants.*_ID constants for standard dialog button ids)
      label - the label from the button
      defaultButton - true if the button is to be the default button, and false otherwise
    • createButtonsGroup

      protected final void createButtonsGroup(Composite parent)
      Creates the buttons for selecting specific types or selecting all or none of the elements.
      Parameters:
      parent - the parent control
    • 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

      Parameters:
      parent - the parent composite
    • createDestinationGroup

      protected abstract void createDestinationGroup(Composite parent)
      Creates the export destination specification visual components.

      Subclasses must implement this method.

      Parameters:
      parent - the parent control
    • createResourcesGroup

      protected final void createResourcesGroup(Composite parent)
      Creates the checkbox tree and list for selecting resources.
      Parameters:
      parent - the parent control
    • getErrorDialogTitle

      protected String getErrorDialogTitle()
      Description copied from class: WizardDataTransferPage
      Get the title for an error dialog. Subclasses should override.
      Overrides:
      getErrorDialogTitle in class WizardDataTransferPage
    • ensureResourcesLocal

      @Deprecated protected boolean ensureResourcesLocal(List resources)
      Deprecated.
      Only retained for backwards compatibility.
      Obsolete method. This was implemented to handle the case where ensureLocal() needed to be called but it doesn't use it any longer.
    • extractNonLocalResources

      protected List extractNonLocalResources(List originalList)
      Returns a new subcollection containing only those resources which are not local.
      Parameters:
      originalList - the original list of resources (element type: IResource)
      Returns:
      the new list of non-local resources (element type: IResource)
    • getShowLinkedResources

      protected boolean getShowLinkedResources()
      Returns {true if the page tree and list providers should show linked resources. Default is false.
      Since:
      3.12
    • updateContentProviders

      protected void updateContentProviders(boolean showLinked)
      Updates the resources tree to show or hide linked resources
      Parameters:
      showLinked - {true if the page should show linked resources
      Since:
      3.12
    • getSelectedResources

      protected List getSelectedResources()
      Returns this page's collection of currently-specified resources to be exported. This is the primary resource selection facility accessor for subclasses.
      Returns:
      a collection of resources currently selected for export (element type: IResource)
    • getSelectedResourcesIterator

      protected Iterator getSelectedResourcesIterator()
      Returns this page's collection of currently-specified resources to be exported. This is the primary resource selection facility accessor for subclasses.
      Returns:
      an iterator over the collection of resources currently selected for export (element type: IResource). This will include white checked folders and individually checked files.
    • getTypesToExport

      protected List getTypesToExport()
      Returns the resource extensions currently specified to be exported.
      Returns:
      the resource extensions currently specified to be exported (element type: String)
    • getWhiteCheckedResources

      protected List getWhiteCheckedResources()
      Returns this page's collection of currently-specified resources to be exported. This returns both folders and files - for just the files use getSelectedResources.
      Returns:
      a collection of resources currently selected for export (element type: IResource)
    • handleTypesEditButtonPressed

      protected void handleTypesEditButtonPressed()
      Queries the user for the types of resources to be exported and selects them in the checkbox group.
    • hasExportableExtension

      protected boolean hasExportableExtension(String resourceName)
      Returns whether the extension of the given resource name is an extension that has been specified for export by the user.
      Parameters:
      resourceName - the resource name
      Returns:
      true if the resource name is suitable for export based upon its extension
    • internalSaveWidgetValues

      protected void internalSaveWidgetValues()
      Persists additional setting that are to be restored in the next instance of this page.

      The WizardImportPage implementation of this method does nothing. Subclasses may extend to persist additional settings.

    • queryResourceTypesToExport

      protected Object[] queryResourceTypesToExport()
      Queries the user for the resource types that are to be exported and returns these types as an array.
      Returns:
      the resource types selected for export (element type: String), or null if the user canceled the selection
    • restoreResourceSpecificationWidgetValues

      protected void restoreResourceSpecificationWidgetValues()
      Restores resource specification control settings that were persisted in the previous instance of this page. Subclasses wishing to restore persisted values for their controls may extend.
    • saveWidgetValues

      protected void saveWidgetValues()
      Persists resource specification control setting that are to be restored in the next instance of this page. Subclasses wishing to persist additional setting for their controls should extend hook method internalSaveWidgetValues.
      Overrides:
      saveWidgetValues in class WizardDataTransferPage
    • setupBasedOnInitialSelections

      protected void setupBasedOnInitialSelections()
      Set the initial selections in the resource group.
    • saveDirtyEditors

      protected boolean saveDirtyEditors()
      Save any editors that the user wants to save before export.
      Returns:
      boolean if the save was successful.
    • updateWidgetEnablements

      protected void updateWidgetEnablements()
      Check if widgets are enabled or disabled by a change in the dialog.
      Overrides:
      updateWidgetEnablements in class WizardDataTransferPage