org.csstudio.ui.util.dialogs
Class ResourceSelectionDialog

java.lang.Object
  extended by Dialog
      extended by org.csstudio.ui.util.dialogs.ResourceSelectionDialog

public final class ResourceSelectionDialog
extends Dialog

This class represents a Dialog to choose a file in the workspace.

Author:
Kai Meyer, Joerg Rathlev

Constructor Summary
ResourceSelectionDialog(Shell parentShell, java.lang.String dialogMessage, java.lang.String[] fileExtensions)
          Creates an input dialog with OK and Cancel buttons.
 
Method Summary
protected  void configureShell(Shell shell)
          
protected  Control createDialogArea(Composite parent)
          
 IPath getSelectedResource()
          Returns the path to the selected resource.
 void handleEvent(Event event)
           
protected  void okPressed()
          
 void setSelectedResource(IPath path)
          Sets the initially selected resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceSelectionDialog

public ResourceSelectionDialog(Shell parentShell,
                               java.lang.String dialogMessage,
                               java.lang.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 Detail

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)


createDialogArea

protected Control createDialogArea(Composite parent)


okPressed

protected void okPressed()


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)