com.tensegrity.gui.swt.dialog.graphfilechooser
Class DefaultGraphFileChooser

java.lang.Object
  extended bycom.tensegrity.gui.swt.dialog.graphfilechooser.DefaultGraphFileChooser
All Implemented Interfaces:
GraphFileChooser

public class DefaultGraphFileChooser
extends java.lang.Object
implements GraphFileChooser

Default implementation of a GraphFileChooser which internally uses a FileDialog

Version:
$Id: DefaultGraphFileChooser.java,v 1.1 2005/12/08 16:29:08 ArndHouben Exp $
Author:
ArndHouben

Constructor Summary
DefaultGraphFileChooser(org.eclipse.swt.widgets.Shell parent)
           
DefaultGraphFileChooser(org.eclipse.swt.widgets.Shell parent, int style)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGraphFileChooser

public DefaultGraphFileChooser(org.eclipse.swt.widgets.Shell parent)

DefaultGraphFileChooser

public DefaultGraphFileChooser(org.eclipse.swt.widgets.Shell parent,
                               int style)
Method Detail

open

public java.lang.String open()
Description copied from interface: GraphFileChooser
Makes the dialog visible and brings it to the front of the display.

Specified by:
open in interface GraphFileChooser
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()
Description copied from interface: GraphFileChooser
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.

Specified by:
getFilterPath in interface GraphFileChooser
Returns:
the directory path string
See Also:
GraphFileChooser.setFilterExtensions(java.lang.String[])

setFilterPath

public void setFilterPath(java.lang.String directory)
Description copied from interface: GraphFileChooser
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.

Specified by:
setFilterPath in interface GraphFileChooser
See Also:
GraphFileChooser.setFilterExtensions(java.lang.String[])

getFileName

public java.lang.String getFileName()
Description copied from interface: GraphFileChooser
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.

Specified by:
getFileName in interface GraphFileChooser
Returns:
the relative path of the file

getFileNames

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

Specified by:
getFileNames in interface GraphFileChooser
Returns:
the relative paths of the files

getStyle

public int getStyle()
Description copied from interface: GraphFileChooser
Returns the currently setted style bits, which must not match style bits setted at construction time

Specified by:
getStyle in interface GraphFileChooser
Returns:
style bits

setFilterExtensions

public void setFilterExtensions(java.lang.String[] extensions)
Description copied from interface: GraphFileChooser
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.

Specified by:
setFilterExtensions in interface GraphFileChooser
Parameters:
extensions - the file extension filter

getFilterExtensions

public java.lang.String[] getFilterExtensions()
Description copied from interface: GraphFileChooser
Returns the file extensions which the dialog will use to filter the files it shows.

Specified by:
getFilterExtensions in interface GraphFileChooser
Returns:
the file extensions filter

setFilterNames

public void setFilterNames(java.lang.String[] names)
Description copied from interface: GraphFileChooser
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.

Specified by:
setFilterNames in interface GraphFileChooser
Parameters:
names - the list of filter names

getFilterNames

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

Specified by:
getFilterNames in interface GraphFileChooser
Returns:
the relative paths of the files


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