com.tensegrity.gui.swt.dialog.graphfilechooser
Interface GraphFileChooser

All Known Implementing Classes:
DefaultGraphFileChooser

public interface GraphFileChooser

Abstraction layer of the FileDialog class. This is needed to exchange the internal file dialog of the SwtGraphFileChooser. For example, the plugin uses a dialog which restricts the root directory to the currently used workspace.

Version:
$Id: GraphFileChooser.java,v 1.1 2005/12/08 16:28:38 ArndHouben Exp $
Author:
ArndHouben

Method Summary
 java.lang.String getFileName()
          Returns the path of the first file that was selected in the dialog relative to the filter path, or an empty string if no such file has been selected.
 java.lang.String[] getFileNames()
          Returns a (possibly empty) array with the paths of all files that were selected in the dialog relative to the filter path.
 java.lang.String[] getFilterExtensions()
          Returns the file extensions which the dialog will use to filter the files it shows.
 java.lang.String[] getFilterNames()
          Returns a (possibly empty) array with the paths of all files that were selected in the dialog relative to the filter path.
 java.lang.String getFilterPath()
          Returns the directory path that the dialog will use, or an empty string if this is not set.
 int getStyle()
          Returns the currently setted style bits, which must not match style bits setted at construction time
 java.lang.String open()
          Makes the dialog visible and brings it to the front of the display.
 void setFilterExtensions(java.lang.String[] extensions)
          Set the file extensions which the dialog will use to filter the files it shows to the argument, which may be null.
 void setFilterNames(java.lang.String[] names)
          Sets the the names that describe the filter extensions which the dialog will use to filter the files it shows to the argument, which may be null.
 void setFilterPath(java.lang.String directory)
          Sets the directory path that the dialog will use to the argument, which may be null.
 

Method Detail

open

public java.lang.String open()
Makes the dialog visible and brings it to the front of the display.

Returns:
a string describing the absolute path of the first selected file, or null if the dialog was cancelled or an error occurred

getFilterPath

public java.lang.String getFilterPath()
Returns the directory path that the dialog will use, or an empty string if this is not set. File names in this path will appear in the dialog, filtered according to the filter extensions.

Returns:
the directory path string
See Also:
setFilterExtensions(java.lang.String[])

setFilterPath

public void setFilterPath(java.lang.String directory)
Sets the directory path that the dialog will use to the argument, which may be null. File names in this path will appear in the dialog, filtered according to the filter extensions. If the string is null, then the operating system's default filter path will be used.

Note that the path string is platform dependent. For convenience, either '/' or '\' can be used as a path separator.

See Also:
setFilterExtensions(java.lang.String[])

getFileName

public java.lang.String getFileName()
Returns the path of the first file that was selected in the dialog relative to the filter path, or an empty string if no such file has been selected.

Returns:
the relative path of the file

getFileNames

public java.lang.String[] getFileNames()
Returns a (possibly empty) array with the paths of all files that were selected in the dialog relative to the filter path.

Returns:
the relative paths of the files

getStyle

public int getStyle()
Returns the currently setted style bits, which must not match style bits setted at construction time

Returns:
style bits

setFilterExtensions

public void setFilterExtensions(java.lang.String[] extensions)
Set the file extensions which the dialog will use to filter the files it shows to the argument, which may be null.

The strings are platform specific. For example, on Windows, an extension filter string is typically of the form "*.extension", where "*.*" matches all files.

Parameters:
extensions - the file extension filter

getFilterExtensions

public java.lang.String[] getFilterExtensions()
Returns the file extensions which the dialog will use to filter the files it shows.

Returns:
the file extensions filter

setFilterNames

public void setFilterNames(java.lang.String[] names)
Sets the the names that describe the filter extensions which the dialog will use to filter the files it shows to the argument, which may be null.

Parameters:
names - the list of filter names

getFilterNames

public java.lang.String[] getFilterNames()
Returns a (possibly empty) array with the paths of all files that were selected in the dialog relative to the filter path.

Returns:
the relative paths of the files


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.