Class DefaultFileSelectionAdapter

java.lang.Object
org.eclipse.swt.events.SelectionAdapter
de.uka.ipd.sdq.workflow.launchconfig.tabs.DefaultFileSelectionAdapter
All Implemented Interfaces:
EventListener, SelectionListener, SWTEventListener

public class DefaultFileSelectionAdapter extends SelectionAdapter
Listener for File selection dialogs. Used to select a default value.
  • Constructor Details

    • DefaultFileSelectionAdapter

      public DefaultFileSelectionAdapter(Text field, String[] fileExtension, String defaultFileURI)
      Instantiates a new default file selection adapter.
      Parameters:
      field - the field
      fileExtension - the file extension
      defaultFileURI - the default file uri
  • Method Details

    • openFileDialog

      protected String openFileDialog(Text textField, String[] fileExtension)
      Opens a file selection dialog. Use getShell() to retrieve the shell and getDialogTitle() 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

      protected String openFileDialog(Text textField, String[] fileExtension, boolean multipleSelection)
      Opens a file selection dialog. Use getShell() to retrieve the shell and getDialogTitle() 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

      protected String openFolderDialog(Text textField)
      Opens a folder selection dialog. Use getShell() to retrieve the shell and getDialogTitle() to retrieve the title within subclasses.
      Parameters:
      textField - The text field which receives the path of the selected folder.
      Returns:
      the string
    • widgetSelected

      public void widgetSelected(SelectionEvent e)
      Specified by:
      widgetSelected in interface SelectionListener
      Overrides:
      widgetSelected in class SelectionAdapter
    • getShell

      protected Shell getShell()
      Gets the shell used for the dialog.
      Returns:
      The shell.
    • getDialogTitle

      public String getDialogTitle()
      Geths the title/message for the dialog.
      Returns:
      The title.