g-Eclipse
Release 1.0.0

eu.geclipse.ui.dialogs
Class GridFileDialog

java.lang.Object
  extended by TitleAreaDialog
      extended by eu.geclipse.ui.dialogs.GridFileDialog

public class GridFileDialog
extends TitleAreaDialog

This is an implementation of a file dialog for both local and remote files that are made available via EFS-implementations. The remote parts make use of the Grid connections that are defined within the user's. The dialog is highly configurable and allows to only show the remote or local parts or both. Furthermore it can be used to select only files or directories or both and only existing or to specify even new files/directories. Last but not least multi- selection may also be possible.


Field Summary
static int STYLE_ALLOW_ONLY_CONNECTIONS
          Style constant for a dialog that allows Grid connections.
static int STYLE_ALLOW_ONLY_EXISTING
          Style constant for a dialog that allows only the selection of existing files/directories.
static int STYLE_ALLOW_ONLY_FILES
          Style constant for a dialog that allows only the selection of files.
static int STYLE_ALLOW_ONLY_FOLDERS
          Style constant for a dialog that allows only the selection of directories.
static int STYLE_ALLOW_ONLY_LOCAL
          Style constant for a dialog that allows only local files, i.e. no Grid connections.
static int STYLE_ALLOW_ONLY_REMOTE_CONNECTIONS
          Style constant for a dialog that allows only remote files, i.e. only Grid connections that are not referring to local files.
static int STYLE_MULTI_SELECTION
          Style contant for a file dialog that allows multi selection.
static int STYLE_NONE
          Style constant for none styles.
 
Constructor Summary
GridFileDialog(Shell parent, int style)
          Create a new dialog with the specified style constant.
 
Method Summary
 void addFileTypeFilter(java.lang.String prefix, java.lang.String description)
          Add a file type filter to this dialog.
 boolean close()
           
 IFileStore[] getSelectedFileStores()
          Get all currently selected IFileStores that meet the style of this dialog.
 java.net.URI[] getSelectedURIs()
          Get all currently selected URIs.
static java.net.URI[] openFileDialog(Shell parent, int style)
          Convenience method to open a file dialog.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_NONE

public static final int STYLE_NONE
Style constant for none styles.

See Also:
Constant Field Values

STYLE_ALLOW_ONLY_LOCAL

public static final int STYLE_ALLOW_ONLY_LOCAL
Style constant for a dialog that allows only local files, i.e. no Grid connections.

See Also:
Constant Field Values

STYLE_ALLOW_ONLY_CONNECTIONS

public static final int STYLE_ALLOW_ONLY_CONNECTIONS
Style constant for a dialog that allows Grid connections.

See Also:
Constant Field Values

STYLE_ALLOW_ONLY_REMOTE_CONNECTIONS

public static final int STYLE_ALLOW_ONLY_REMOTE_CONNECTIONS
Style constant for a dialog that allows only remote files, i.e. only Grid connections that are not referring to local files.

See Also:
Constant Field Values

STYLE_ALLOW_ONLY_FILES

public static final int STYLE_ALLOW_ONLY_FILES
Style constant for a dialog that allows only the selection of files.

See Also:
Constant Field Values

STYLE_ALLOW_ONLY_FOLDERS

public static final int STYLE_ALLOW_ONLY_FOLDERS
Style constant for a dialog that allows only the selection of directories.

See Also:
Constant Field Values

STYLE_ALLOW_ONLY_EXISTING

public static final int STYLE_ALLOW_ONLY_EXISTING
Style constant for a dialog that allows only the selection of existing files/directories. The filename and url combos can not be edited.

See Also:
Constant Field Values

STYLE_MULTI_SELECTION

public static final int STYLE_MULTI_SELECTION
Style contant for a file dialog that allows multi selection.

See Also:
Constant Field Values
Constructor Detail

GridFileDialog

public GridFileDialog(Shell parent,
                      int style)
Create a new dialog with the specified style constant.

Parameters:
parent - The dialog's parent Shell.
style - The dialog's style, i.e. a bitwise or of style constants.
Method Detail

openFileDialog

public static java.net.URI[] openFileDialog(Shell parent,
                                            int style)
Convenience method to open a file dialog. If filters have to be specified this method may not be used.

Parameters:
parent - The dialog's parent Shell.
style - The dialog's style, i.e. a bitwise or of style constants.
Returns:
Array containing the URIs of all selected elements or null if no selection is available.

addFileTypeFilter

public void addFileTypeFilter(java.lang.String prefix,
                              java.lang.String description)
Add a file type filter to this dialog. The filter will appear in the file type combo.

Parameters:
prefix - The prefix of files that will be shown.
description - A description of the filter. This description will be shown in the file type combo.

close

public boolean close()

getSelectedFileStores

public IFileStore[] getSelectedFileStores()
Get all currently selected IFileStores that meet the style of this dialog.

Returns:
Array containing the IFileStores of all selected elements or null if no selection is available.

getSelectedURIs

public java.net.URI[] getSelectedURIs()
Get all currently selected URIs.

Returns:
Array containing the URIs of all selected elements or null if no selection is available.

g-Eclipse
Release 1.0.0