Class DefaultFileSelectionAdapter
java.lang.Object
org.eclipse.swt.events.SelectionAdapter
de.uka.ipd.sdq.workflow.launchconfig.tabs.DefaultFileSelectionAdapter
- All Implemented Interfaces:
EventListener
,SelectionListener
,SWTEventListener
Listener for File selection dialogs. Used to select a default value.
-
Constructor Summary
ConstructorDescriptionDefaultFileSelectionAdapter
(Text field, String[] fileExtension, String defaultFileURI) Instantiates a new default file selection adapter. -
Method Summary
Modifier and TypeMethodDescriptionGeths the title/message for the dialog.protected Shell
getShell()
Gets the shell used for the dialog.protected String
openFileDialog
(Text textField, String[] fileExtension) Opens a file selection dialog.protected String
openFileDialog
(Text textField, String[] fileExtension, boolean multipleSelection) Opens a file selection dialog.protected String
openFolderDialog
(Text textField) Opens a folder selection dialog.void
Methods inherited from class org.eclipse.swt.events.SelectionAdapter
widgetDefaultSelected
-
Constructor Details
-
DefaultFileSelectionAdapter
Instantiates a new default file selection adapter.- Parameters:
field
- the fieldfileExtension
- the file extensiondefaultFileURI
- the default file uri
-
-
Method Details
-
openFileDialog
Opens a file selection dialog. UsegetShell()
to retrieve the shell andgetDialogTitle()
to retrieve the title within subclasses.- Parameters:
textField
- The text field which receives the path of the selected file.fileExtension
- The extension which are allowed for the selected file.- Returns:
- the string
-
openFileDialog
Opens a file selection dialog. UsegetShell()
to retrieve the shell andgetDialogTitle()
to retrieve the title within subclasses.- Parameters:
textField
- The text field which receives the path of the selected file.fileExtension
- The extension which are allowed for the selected file.multipleSelection
- indicates whether multiple elements can be selected in the file dialog.- Returns:
- the string
-
openFolderDialog
Opens a folder selection dialog. UsegetShell()
to retrieve the shell andgetDialogTitle()
to retrieve the title within subclasses.- Parameters:
textField
- The text field which receives the path of the selected folder.- Returns:
- the string
-
widgetSelected
- Specified by:
widgetSelected
in interfaceSelectionListener
- Overrides:
widgetSelected
in classSelectionAdapter
-
getShell
Gets the shell used for the dialog.- Returns:
- The shell.
-
getDialogTitle
Geths the title/message for the dialog.- Returns:
- The title.
-