Class WizardExportResourcesPage
- java.lang.Object
-
- org.eclipse.jface.dialogs.DialogPage
-
- org.eclipse.jface.wizard.WizardPage
-
- org.eclipse.ui.dialogs.WizardDataTransferPage
-
- org.eclipse.ui.dialogs.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
-
-
Field Summary
-
Fields inherited from class org.eclipse.ui.dialogs.WizardDataTransferPage
COMBO_HISTORY_LENGTH, SIZING_TEXT_FIELD_WIDTH
-
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WizardExportResourcesPage(String pageName, IStructuredSelection selection)
Creates an export wizard page.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
allowNewContainerName()
TheaddToHierarchyToCheckedStore
implementation of thisWizardDataTransferPage
method returnsfalse
.protected Button
createButton(Composite parent, int id, String label, boolean defaultButton)
Creates a new button with the given id.protected void
createButtonsGroup(Composite parent)
Creates the buttons for selecting specific types or selecting all or none of the elements.void
createControl(Composite parent)
Creates the top level control for this dialog page under the given parent composite.protected abstract void
createDestinationGroup(Composite parent)
Creates the export destination specification visual components.protected void
createResourcesGroup(Composite parent)
Creates the checkbox tree and list for selecting resources.protected boolean
ensureResourcesLocal(List resources)
Deprecated.Only retained for backwards compatibility.protected List
extractNonLocalResources(List originalList)
Returns a new subcollection containing only those resources which are not local.protected String
getErrorDialogTitle()
Get the title for an error dialog.protected List
getSelectedResources()
Returns this page's collection of currently-specified resources to be exported.protected Iterator
getSelectedResourcesIterator()
Returns this page's collection of currently-specified resources to be exported.protected boolean
getShowLinkedResources()
Returns {true
if the page tree and list providers should show linked resources.protected List
getTypesToExport()
Returns the resource extensions currently specified to be exported.protected List
getWhiteCheckedResources()
Returns this page's collection of currently-specified resources to be exported.protected void
handleTypesEditButtonPressed()
Queries the user for the types of resources to be exported and selects them in the checkbox group.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.protected void
internalSaveWidgetValues()
Persists additional setting that are to be restored in the next instance of this page.protected Object[]
queryResourceTypesToExport()
Queries the user for the resource types that are to be exported and returns these types as an array.protected void
restoreResourceSpecificationWidgetValues()
Restores resource specification control settings that were persisted in the previous instance of this page.protected boolean
saveDirtyEditors()
Save any editors that the user wants to save before export.protected void
saveWidgetValues()
Persists resource specification control setting that are to be restored in the next instance of this page.protected void
setupBasedOnInitialSelections()
Set the initial selections in the resource group.protected void
updateContentProviders(boolean showLinked)
Updates the resources tree to show or hide linked resourcesprotected void
updateWidgetEnablements()
Check if widgets are enabled or disabled by a change in the dialog.-
Methods inherited from class org.eclipse.ui.dialogs.WizardDataTransferPage
addToHistory, addToHistory, createBoldLabel, createOptionsGroup, createOptionsGroupButtons, createPlainLabel, createSpacer, determinePageCompletion, displayErrorDialog, displayErrorDialog, getPathFromText, queryForContainer, queryForContainer, queryOverwrite, queryYesNoQuestion, restoreWidgetValues, updatePageCompletion, validateDestinationGroup, validateOptionsGroup, validateSourceGroup
-
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
-
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisible
-
Methods inherited from interface org.eclipse.swt.widgets.Listener
handleEvent
-
-
-
-
Constructor Detail
-
WizardExportResourcesPage
protected WizardExportResourcesPage(String pageName, IStructuredSelection selection)
Creates an export wizard page. If the current resource selection is not empty then it will be used as the initial collection of resources selected for export.- Parameters:
pageName
- the name of the pageselection
-IStructuredSelection
ofIResource
- See Also:
IDE.computeSelectedResources(IStructuredSelection)
-
-
Method Detail
-
allowNewContainerName
protected boolean allowNewContainerName()
TheaddToHierarchyToCheckedStore
implementation of thisWizardDataTransferPage
method returnsfalse
. Subclasses may override this method.- Specified by:
allowNewContainerName
in classWizardDataTransferPage
- Returns:
true
if new ones are okay, andfalse
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 compositeid
- the id of the button (seeIDialogConstants.*_ID
constants for standard dialog button ids)label
- the label from the buttondefaultButton
-true
if the button is to be the default button, andfalse
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 classWizardDataTransferPage
-
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
), ornull
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 methodinternalSaveWidgetValues
.- Overrides:
saveWidgetValues
in classWizardDataTransferPage
-
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 classWizardDataTransferPage
-
-