|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.wizard.WizardPage
de.cau.cs.kieler.core.ui.wizards.ResourceTreeAndListPage
de.cau.cs.kieler.core.ui.wizards.FileSystemResourcesPage
public class FileSystemResourcesPage
A wizard page that allows the user to choose files to import from the file system. Optionally, a target group may allow the user to choose a target folder in the workspace to import to. Files can be filtered using regular expressions.
The settings made on this page can be saved if the wizard has an instance of
IDialogSettings
set on it. If it has not, settings are neither saved nor
loaded.
Field Summary |
---|
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider |
---|
ERROR, INFORMATION, NONE, WARNING |
Constructor Summary | |
---|---|
FileSystemResourcesPage(String pageName,
boolean showTargetGroup)
Constructs a new instance with the given name that doesn't filter out any files. |
|
FileSystemResourcesPage(String pageName,
boolean showTargetGroup,
String fileNamePattern)
Constructs a new instance with the given name, using a regular expression as its file name filter. |
|
FileSystemResourcesPage(String pageName,
boolean showTargetGroup,
String[] fileExtensions)
Constructs a new instance with the given name, using a regular expression as its file name filter. |
Method Summary | |
---|---|
protected void |
applyNewSource(String text)
Called when the source group combo loses focus. |
protected void |
applyNewTarget(String text)
Called when the target group combo loses focus. |
protected Composite |
createOptionsGroup(Composite parent)
Creates the options group. |
protected Composite |
createSourceGroup(Composite parent)
Creates the source group. |
protected Composite |
createTargetGroup(Composite parent)
Creates the target group. |
protected void |
doBrowseSource()
Called when the source group browse button is clicked. |
protected void |
doBrowseTarget()
Called when the target group browse button is clicked. |
protected boolean |
doValidate()
Validates the page. |
List<File> |
getFiles(IProgressMonitor monitor)
Returns the selected files. |
protected ITreeContentProvider |
getResourceListContentProvider()
Returns the content provider to be used for the resource list. |
protected ViewerFilter[] |
getResourceListFilters()
Returns the viewer filters to be used for the resource list. |
protected ITreeContentProvider |
getResourceTreeContentProvider()
Returns the content provider to be used for the resource tree. |
IPath |
getTargetContainerPath()
Returns the target container path entered by the user. |
protected void |
restoreDialogSettings()
Restores the user's saved input. |
void |
saveDialogSettings()
Saves the user's input. |
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 |
Constructor Detail |
---|
public FileSystemResourcesPage(String pageName, boolean showTargetGroup)
pageName
- name of the page. Used as part of the IDs the dialog
settings are saved as.showTargetGroup
- if true
, a target group is created
where the user can select a folder in the
workspace to import to.public FileSystemResourcesPage(String pageName, boolean showTargetGroup, String fileNamePattern)
pageName
- name of the page. Used as part of the IDs the dialog
settings are saved as.showTargetGroup
- if true
, a target group is created
where the user can select a folder in the
workspace to import to.fileNamePattern
- file name pattern, specified as a regular
expression.public FileSystemResourcesPage(String pageName, boolean showTargetGroup, String[] fileExtensions)
pageName
- name of the page. Used as part of the IDs the dialog
settings are saved as.showTargetGroup
- if true
, a target group is created
where the user can select a folder in the
workspace to import to.fileExtensions
- a list of file extensions, either with or without preceding
dot, that determines the files that will be shown to the
user.Method Detail |
---|
public List<File> getFiles(IProgressMonitor monitor)
monitor
- progress monitor. May be null
.
public IPath getTargetContainerPath()
protected ITreeContentProvider getResourceTreeContentProvider()
BaseWorkbenchContentProvider
.
getResourceTreeContentProvider
in class ResourceTreeAndListPage
protected ViewerFilter[] getResourceListFilters()
Note: This could be made more flexible to allow changeing the list of active filters after creation.
getResourceListFilters
in class ResourceTreeAndListPage
protected ITreeContentProvider getResourceListContentProvider()
BaseWorkbenchContentProvider
.
getResourceListContentProvider
in class ResourceTreeAndListPage
protected Composite createSourceGroup(Composite parent)
Subclasses may call ResourceTreeAndListPage.createDefaultSourceGroup(Composite, String, String)
to have a default source group with a label, a combo box and a browse
button created. In this case, it should also implement ResourceTreeAndListPage.applyNewSource(String)
and ResourceTreeAndListPage.doBrowseSource()
. While access to the combo box and the browse
button shouldn't normally be necessary, they can be retrieved using
ResourceTreeAndListPage.getSourceGroupCombo()
and ResourceTreeAndListPage.getSourceGroupBrowseButton()
.
createSourceGroup
in class ResourceTreeAndListPage
parent
- the new source group's parent.
null
if none should be shown.protected void applyNewSource(String text)
After this method was called, ResourceTreeAndListPage.validate()
is called automatically.
applyNewSource
in class ResourceTreeAndListPage
text
- the combo's current text.protected void doBrowseSource()
After this method was called, ResourceTreeAndListPage.validate()
is called automatically.
doBrowseSource
in class ResourceTreeAndListPage
protected Composite createTargetGroup(Composite parent)
Subclasses may call ResourceTreeAndListPage.createDefaultTargetGroup(Composite, String, String)
to have a default target group with a label, a combo box and a browse
button created. In this case, it should also implement ResourceTreeAndListPage.applyNewTarget(String)
and ResourceTreeAndListPage.doBrowseTarget()
. While access to the combo box and the browse
button shouldn't normally be necessary, they can be retrieved using
ResourceTreeAndListPage.getTargetGroupCombo()
and ResourceTreeAndListPage.getTargetGroupBrowseButton()
.
createTargetGroup
in class ResourceTreeAndListPage
parent
- the new target group's parent.
null
if none should be shown.protected void applyNewTarget(String text)
After this method was called, ResourceTreeAndListPage.validate()
is called automatically.
applyNewTarget
in class ResourceTreeAndListPage
text
- the combo's current text.protected void doBrowseTarget()
After this method was called, ResourceTreeAndListPage.validate()
is called automatically.
doBrowseTarget
in class ResourceTreeAndListPage
protected Composite createOptionsGroup(Composite parent)
createOptionsGroup
in class ResourceTreeAndListPage
parent
- the new options group's parent.
null
if none should be shown.protected boolean doValidate()
true
.
doValidate
in class ResourceTreeAndListPage
true
if the page validates fine and the page is complete,
false
otherwise.public void saveDialogSettings()
saveDialogSettings
in class ResourceTreeAndListPage
protected void restoreDialogSettings()
restoreDialogSettings
in class ResourceTreeAndListPage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |