com.mindoo.remote.api.org.eclipse.ui.tools
Interface IRemoteFileDialogTools


public interface IRemoteFileDialogTools

Set of useful methods to open platform specific file dialogs


Field Summary
static int MULTI
          Style constant for multi-selection behavior in lists and multiple line support on text fields (value is 1<<1=2).
static int OPEN
          The FileDialog style constant for open file dialog behavior (value is 1<<12=4096).
static int SAVE
          The FileDialog style constant for save file dialog behavior (value is 1<<13=8192).
static int SINGLE
          Style constant for single selection behavior in lists and single line support on text fields (value is 1<<2=4).
 
Method Summary
 java.lang.String showDirectoryDialog(java.lang.String filterPath, java.lang.String msg)
          Displays a dialog to select a directory
 java.lang.String[] showFileDialog(int type, java.lang.String[] filterNames, java.lang.String[] filterExt, int filterIndex, java.lang.String filterPath, java.lang.String fileName, boolean overwrite, java.lang.String dlgText)
          Most powerful method to open a file dialog.
 java.lang.String showFileOpenDialog()
          Opens a simple open dialog with default title and no filter
 java.lang.String showFileSaveDialog(java.lang.String defaultFileName, boolean overwrite)
          Opens a simple save dialog with default title and no filter
 

Field Detail

OPEN

static final int OPEN
The FileDialog style constant for open file dialog behavior (value is 1<<12=4096).

See Also:
Constant Field Values

SAVE

static final int SAVE
The FileDialog style constant for save file dialog behavior (value is 1<<13=8192).

See Also:
Constant Field Values

MULTI

static final int MULTI
Style constant for multi-selection behavior in lists and multiple line support on text fields (value is 1<<1=2).

See Also:
Constant Field Values

SINGLE

static final int SINGLE
Style constant for single selection behavior in lists and single line support on text fields (value is 1<<2=4).

See Also:
Constant Field Values
Method Detail

showFileDialog

java.lang.String[] showFileDialog(int type,
                                  java.lang.String[] filterNames,
                                  java.lang.String[] filterExt,
                                  int filterIndex,
                                  java.lang.String filterPath,
                                  java.lang.String fileName,
                                  boolean overwrite,
                                  java.lang.String dlgText)
                                  throws RemoteEclipseAPIException
Most powerful method to open a file dialog. Most if not all of the parameters can be null.
We just offer everything that the underlying SWT implementation has to offer.

Parameters:
type - bit combination of OPEN, SAVE, MULTI and SINGLE
filterNames - Sets the names that describe the filter extensions which the dialog will use to filter the files it shows to the argument. Or use null to not define filter names
filterExt - Set the file extensions which the dialog will use to filter the files it shows to the argument. For filters with multiple extensions, use semicolon as a separator, e.g. "*.jpg;*.png". Or use null to not define filter extensions
filterIndex - Set the 0-based index of the file extension filter which the dialog will use initially to filter the files it shows to the argument. This is an index into the FilterExtensions array and the FilterNames array, or -1 to not set the index
filterPath - Sets the directory path that the dialog will use or null
fileName - filename that should be displayed as default or null
overwrite - Sets the flag that the dialog will use to determine whether to prompt the user for file overwrite if the selected file already exists
dlgText - title of the file dialog or null to use default
Returns:
Array of file paths or null, if the dialog has been canceled
Throws:
RemoteEclipseAPIException

showFileOpenDialog

java.lang.String showFileOpenDialog()
                                    throws RemoteEclipseAPIException
Opens a simple open dialog with default title and no filter

Returns:
filepath of selected file or null
Throws:
RemoteEclipseAPIException

showFileSaveDialog

java.lang.String showFileSaveDialog(java.lang.String defaultFileName,
                                    boolean overwrite)
                                    throws RemoteEclipseAPIException
Opens a simple save dialog with default title and no filter

Parameters:
defaultFileName - filename that should be displayed as default or null
overwrite - Sets the flag that the dialog will use to determine whether to prompt the user for file overwrite if the selected file already exists
Returns:
filepath of selected file or null
Throws:
RemoteEclipseAPIException

showDirectoryDialog

java.lang.String showDirectoryDialog(java.lang.String filterPath,
                                     java.lang.String msg)
                                     throws RemoteEclipseAPIException
Displays a dialog to select a directory

Parameters:
filterPath - Sets the path that the dialog will use to filter the directories it shows to the argument, which may be null. If the string is null, then the operating system's default filter path will be used.
msg - Sets the dialog's message, which is a description of the purpose for which it was opened. This message will be visible on the dialog while it is open, can be null
Returns:
a string describing the absolute path of the selected directory, or null if the dialog was cancelled or an error occurred
Throws:
RemoteEclipseAPIException