Class ResourceSelectionDialog

java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.csstudio.ui.util.dialogs.ResourceSelectionDialog
All Implemented Interfaces:
IShellProvider, Listener

public final class ResourceSelectionDialog extends Dialog implements Listener
This class represents a Dialog to choose a file in the workspace.
  • Constructor Details

    • ResourceSelectionDialog

      public ResourceSelectionDialog(Shell parentShell, String dialogMessage, String[] fileExtensions)
      Creates an input dialog with OK and Cancel buttons. Note that the dialog will have no visual representation (no widgets) until it is told to open.

      Note that the open method blocks for input dialogs.

      Parameters:
      parentShell - the parent shell, or null to create a top-level shell
      dialogMessage - the dialog message, or null if none
      fileExtensions - the file extensions of files to show in the dialog. Use an empty array or null to show only containers (folders).
  • Method Details

    • setSelectedResource

      public void setSelectedResource(IPath path)
      Sets the initially selected resource. Must be called before the dialog is displayed.
      Parameters:
      path - the path to the initially selected resource.
    • configureShell

      protected void configureShell(Shell shell)
      Overrides:
      configureShell in class Window
    • createDialogArea

      protected Control createDialogArea(Composite parent)
      Overrides:
      createDialogArea in class Dialog
    • okPressed

      protected void okPressed()
      Overrides:
      okPressed in class Dialog
    • getSelectedResource

      public IPath getSelectedResource()
      Returns the path to the selected resource.
      Returns:
      the path to the selected resource, or null if no resource was selected.
    • handleEvent

      public void handleEvent(Event event)
      Specified by:
      handleEvent in interface Listener