Class WizardResourceImportPage

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

public abstract class WizardResourceImportPage extends WizardDataTransferPage
The abstract superclass for a typical import wizard's main page.

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

Subclasses must implement

  • createSourceGroup

Subclasses may override

  • allowNewContainerName

Subclasses may extend

  • handleEvent
  • Field Details

    • selectedTypes

      protected List<Object> selectedTypes
    • selectionGroup

      protected ResourceTreeAndListGroup selectionGroup
      The selectionGroup field should have been created with a private modifier. Subclasses should not access this field directly.
      Restriction:
      This field is not intended to be referenced by clients.
  • Constructor Details

    • WizardResourceImportPage

      protected WizardResourceImportPage(String name, IStructuredSelection selection)
      Creates an import wizard page. If the initial resource selection contains exactly one container resource then it will be used as the default import destination.
      Parameters:
      name - the name of the page
      selection - the current resource selection
  • Method Details

    • allowNewContainerName

      protected boolean allowNewContainerName()
      The WizardResourceImportPage implementation of this WizardDataTransferPage method returns true. 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
    • 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 void createDestinationGroup(Composite parent)
      Creates the import destination specification controls.
      Parameters:
      parent - the parent control
    • createFileSelectionGroup

      protected void createFileSelectionGroup(Composite parent)
      Create the import source selection widget
    • createSourceGroup

      protected abstract void createSourceGroup(Composite parent)
      Creates the import source specification controls.

      Subclasses must implement this method.

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

      protected IPath getContainerFullPath()
      Returns the path of the container resource specified in the container name entry field, or null if no name has been typed in.

      The container specified by the full path might not exist and would need to be created.

      Returns:
      the full path of the container resource specified in the container name entry field, or null
    • getFileProvider

      protected abstract ITreeContentProvider getFileProvider()
      Returns a content provider for FileSystemElements that returns only files as children.
    • getFolderProvider

      protected abstract ITreeContentProvider getFolderProvider()
      Returns a content provider for FileSystemElements that returns only folders as children.
    • getResourcePath

      protected IPath getResourcePath()
      Return the path for the resource field.
      Returns:
      IPath
    • getSelectedResources

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

      protected void getSelectedResources(IElementFilter filter, IProgressMonitor monitor) throws InterruptedException
      Returns this page's list of currently-specified resources to be imported filtered by the IElementFilter.
      Throws:
      InterruptedException
      Since:
      3.10
    • getSelectedResources

      @Deprecated protected void getSelectedResources(org.eclipse.ui.internal.ide.dialogs.IElementFilter filter, IProgressMonitor monitor) throws InterruptedException
      Deprecated.
      Should use the API IElementFilter
      DO NOT USE THIS METHOD Returns this page's list of currently-specified resources to be imported filtered by the IElementFilter.
      Throws:
      InterruptedException
    • getSpecifiedContainer

      protected IContainer getSpecifiedContainer()
      Returns the container resource specified in the container name entry field, or null if such a container does not exist in the workbench.
      Returns:
      the container resource specified in the container name entry field, or null
    • getTypesToImport

      protected List getTypesToImport()
      Returns a collection of the currently-specified resource types for use by the type selection dialog.
    • handleContainerBrowseButtonPressed

      protected void handleContainerBrowseButtonPressed()
      Opens a container selection dialog and displays the user's subsequent container resource selection in this page's container name field.
    • handleEvent

      public void handleEvent(Event event)
      The WizardResourceImportPage implementation of this Listener method handles all events and enablements for controls on this page. Subclasses may extend.
      Parameters:
      event - Event
    • handleTypesEditButtonPressed

      protected void handleTypesEditButtonPressed()
      Open a registered type selection dialog and note the selections in the receivers types-to-export field
    • initialPopulateContainerField

      protected final void initialPopulateContainerField()
      Sets the initial contents of the container name field.
    • setAllSelections

      protected void setAllSelections(boolean value)
      Set all of the selections in the selection group to value
      Parameters:
      value - boolean
    • setContainerFieldValue

      public void setContainerFieldValue(String value)
      Sets the value of this page's container resource field, or stores it for future use if this page's controls do not exist yet.
      Parameters:
      value - String
    • setupSelectionsBasedOnSelectedTypes

      protected void setupSelectionsBasedOnSelectedTypes()
      Update the tree to only select those elements that match the selected types. Do nothing by default.
    • updateSelections

      protected void updateSelections(Map map)
      Update the selections with those in map .
      Parameters:
      map - Map - key tree elements, values Lists of list elements
    • updateWidgetEnablements

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

      protected final boolean validateDestinationGroup()
      Description copied from class: WizardDataTransferPage
      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.

      Overrides:
      validateDestinationGroup in class WizardDataTransferPage
      Returns:
      true indicating validity of all controls in the destination specification group
    • getSourceConflictMessage

      protected final String getSourceConflictMessage()
      Returns the error message for when the source conflicts with the destination.
    • sourceConflictsWithDestination

      protected boolean sourceConflictsWithDestination(IPath sourcePath)
      Returns whether or not the source location conflicts with the destination resource. By default this is not checked, so false is returned.
      Parameters:
      sourcePath - the path being checked
      Returns:
      true if the source location conflicts with the destination resource, false if not
    • determinePageCompletion

      protected boolean determinePageCompletion()
      Description copied from class: WizardDataTransferPage
      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.
      Overrides:
      determinePageCompletion in class WizardDataTransferPage
      Returns:
      true if this page is complete, and false if incomplete
      See Also: