Package org.eclipse.ui.dialogs
Class WizardResourceImportPage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.wizard.WizardPage
org.eclipse.ui.dialogs.WizardDataTransferPage
org.eclipse.ui.dialogs.WizardResourceImportPage
- All Implemented Interfaces:
IDialogPage,IMessageProvider,IWizardPage,Listener,IOverwriteQuery
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 Summary
FieldsModifier and TypeFieldDescriptionprotected ResourceTreeAndListGroupTheselectionGroupfield should have been created with a private modifier.Fields inherited from class org.eclipse.ui.dialogs.WizardDataTransferPage
COMBO_HISTORY_LENGTH, SIZING_TEXT_FIELD_WIDTHFields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWizardResourceImportPage(String name, IStructuredSelection selection) Creates an import wizard page. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanTheWizardResourceImportPageimplementation of thisWizardDataTransferPagemethod returnstrue.voidcreateControl(Composite parent) Creates the top level control for this dialog page under the given parent composite.protected voidcreateDestinationGroup(Composite parent) Creates the import destination specification controls.protected voidcreateFileSelectionGroup(Composite parent) Create the import source selection widgetprotected abstract voidcreateSourceGroup(Composite parent) Creates the import source specification controls.protected booleanReturns whether this page is complete.protected IPathReturns the path of the container resource specified in the container name entry field, ornullif no name has been typed in.protected StringGet the title for an error dialog.protected abstract ITreeContentProviderReturns a content provider forFileSystemElements that returns only files as children.protected abstract ITreeContentProviderReturns a content provider forFileSystemElements that returns only folders as children.protected IPathReturn the path for the resource field.protected ListReturns this page's list of currently-specified resources to be imported.protected voidgetSelectedResources(IElementFilter filter, IProgressMonitor monitor) Returns this page's list of currently-specified resources to be imported filtered by the IElementFilter.protected voidgetSelectedResources(org.eclipse.ui.internal.ide.dialogs.IElementFilter filter, IProgressMonitor monitor) Deprecated.protected final StringReturns the error message for when the source conflicts with the destination.protected IContainerReturns the container resource specified in the container name entry field, ornullif such a container does not exist in the workbench.protected ListReturns a collection of the currently-specified resource types for use by the type selection dialog.protected voidOpens a container selection dialog and displays the user's subsequent container resource selection in this page's container name field.voidhandleEvent(Event event) TheWizardResourceImportPageimplementation of thisListenermethod handles all events and enablements for controls on this page.protected voidOpen a registered type selection dialog and note the selections in the receivers types-to-export fieldprotected final voidSets the initial contents of the container name field.protected voidsetAllSelections(boolean value) Set all of the selections in the selection group to valuevoidsetContainerFieldValue(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.protected voidUpdate the tree to only select those elements that match the selected types.protected booleansourceConflictsWithDestination(IPath sourcePath) Returns whether or not the source location conflicts with the destination resource.protected voidupdateSelections(Map map) Update the selections with those in map .protected voidCheck if widgets are enabled or disabled by a change in the dialog.protected final booleanReturns whether this page's destination specification controls currently all contain valid values.Methods inherited from class org.eclipse.ui.dialogs.WizardDataTransferPage
addToHistory, addToHistory, createBoldLabel, createOptionsGroup, createOptionsGroupButtons, createPlainLabel, createSpacer, displayErrorDialog, displayErrorDialog, getPathFromText, queryForContainer, queryForContainer, queryOverwrite, queryYesNoQuestion, restoreWidgetValues, saveWidgetValues, updatePageCompletion, validateOptionsGroup, validateSourceGroupMethods 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, toStringMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisibleMethods inherited from interface org.eclipse.jface.wizard.IWizardPage
getMinimumPageSize
-
Field Details
-
selectedTypes
-
selectionGroup
TheselectionGroupfield 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
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 pageselection- the current resource selection
-
-
Method Details
-
allowNewContainerName
protected boolean allowNewContainerName()TheWizardResourceImportPageimplementation of thisWizardDataTransferPagemethod returnstrue. Subclasses may override this method.- Specified by:
allowNewContainerNamein classWizardDataTransferPage- Returns:
trueif new ones are okay, andfalseif only existing ones are allowed
-
createControl
Description copied from interface:IDialogPageCreates 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
Creates the import destination specification controls.- Parameters:
parent- the parent control
-
createFileSelectionGroup
Create the import source selection widget -
createSourceGroup
Creates the import source specification controls.Subclasses must implement this method.
- Parameters:
parent- the parent control
-
getErrorDialogTitle
Description copied from class:WizardDataTransferPageGet the title for an error dialog. Subclasses should override.- Overrides:
getErrorDialogTitlein classWizardDataTransferPage
-
getContainerFullPath
Returns the path of the container resource specified in the container name entry field, ornullif 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
Returns a content provider forFileSystemElements that returns only files as children. -
getFolderProvider
Returns a content provider forFileSystemElements that returns only folders as children. -
getResourcePath
Return the path for the resource field.- Returns:
- IPath
-
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 APIIElementFilterDO NOT USE THIS METHOD Returns this page's list of currently-specified resources to be imported filtered by the IElementFilter.- Throws:
InterruptedException
-
getSpecifiedContainer
Returns the container resource specified in the container name entry field, ornullif such a container does not exist in the workbench.- Returns:
- the container resource specified in the container name entry field,
or
null
-
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
TheWizardResourceImportPageimplementation of thisListenermethod 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
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
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:
updateWidgetEnablementsin classWizardDataTransferPage
-
validateDestinationGroup
protected final boolean validateDestinationGroup()Description copied from class:WizardDataTransferPageReturns whether this page's destination specification controls currently all contain valid values.The
WizardDataTransferPageimplementation of this method returnstrue. Subclasses may reimplement this hook method.- Overrides:
validateDestinationGroupin classWizardDataTransferPage- Returns:
trueindicating validity of all controls in the destination specification group
-
getSourceConflictMessage
Returns the error message for when the source conflicts with the destination. -
sourceConflictsWithDestination
Returns whether or not the source location conflicts with the destination resource. By default this is not checked, sofalseis returned.- Parameters:
sourcePath- the path being checked- Returns:
trueif the source location conflicts with the destination resource,falseif not
-
determinePageCompletion
protected boolean determinePageCompletion()Description copied from class:WizardDataTransferPageReturns 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 methodsvalidateSourceGroupand/orvalidateOptionsGroup.- Overrides:
determinePageCompletionin classWizardDataTransferPage- Returns:
trueif this page is complete, andfalseif incomplete- See Also:
-
IElementFilter