com.sun.electric.tool.user.dialogs
Class OpenFile

java.lang.Object
  extended by com.sun.electric.tool.user.dialogs.OpenFile

public class OpenFile
extends java.lang.Object

Class to handle file selection dialogs.


Constructor Summary
OpenFile()
           
 
Method Summary
static java.lang.String chooseDirectory(java.lang.String title)
          Factory method to create a new open dialog box to search for a directory.
static java.lang.String chooseInputFile(FileType type, java.lang.String title)
          Factory method to create a new open dialog box using the default Type.
static java.lang.String chooseInputFile(FileType type, java.lang.String title, boolean wantDirectory)
          Factory method to create a new open dialog box using the default Type.
static java.lang.String chooseInputFile(FileType type, java.lang.String title, boolean wantDirectory, java.lang.String initialDir, boolean setSelectedDirAsWorkingDir)
          Factory method to create a new open dialog box using the default Type.
static java.lang.String chooseOutputFile(FileType[] types, java.lang.String title, java.lang.String defaultFile)
          Factory method to create a new save dialog box using the default EFileFilter.
static java.lang.String chooseOutputFile(FileType type, java.lang.String title, java.lang.String defaultFile)
          Factory method to create a new save dialog box using the default EFileFilter.
static FileType getOpenFileType(java.lang.String libName, FileType def)
          Method to determine OpenFile type based on extension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenFile

public OpenFile()
Method Detail

chooseInputFile

public static java.lang.String chooseInputFile(FileType type,
                                               java.lang.String title)
Factory method to create a new open dialog box using the default Type.

Parameters:
type - the type of file to read. Defaults to ANY if null.
title - dialog title to use; if null uses "Open 'filetype'".

chooseDirectory

public static java.lang.String chooseDirectory(java.lang.String title)
Factory method to create a new open dialog box to search for a directory.

Parameters:
title - dialog title to use; if null uses "Select Directory".

chooseInputFile

public static java.lang.String chooseInputFile(FileType type,
                                               java.lang.String title,
                                               boolean wantDirectory)
Factory method to create a new open dialog box using the default Type.

Parameters:
type - the type of file to read. Defaults to ANY if null.
title - dialog title to use; if null uses "Open 'filetype'".
wantDirectory - true to request a directory be selected, instead of a file.

chooseInputFile

public static java.lang.String chooseInputFile(FileType type,
                                               java.lang.String title,
                                               boolean wantDirectory,
                                               java.lang.String initialDir,
                                               boolean setSelectedDirAsWorkingDir)
Factory method to create a new open dialog box using the default Type.

Parameters:
type - the type of file to read. Defaults to ANY if null.
title - dialog title to use; if null uses "Open 'filetype'".
wantDirectory - true to request a directory be selected, instead of a file.
initialDir - the initial directory
setSelectedDirAsWorkingDir - if the user approves the selection, set the directory as the current working dir if this is true.

chooseOutputFile

public static java.lang.String chooseOutputFile(FileType type,
                                                java.lang.String title,
                                                java.lang.String defaultFile)
Factory method to create a new save dialog box using the default EFileFilter.

Parameters:
type - the type of file. Defaults to ANY if null.
title - dialog title to use; if null uses "Write 'filetype'".
defaultFile - default file name to write.

chooseOutputFile

public static java.lang.String chooseOutputFile(FileType[] types,
                                                java.lang.String title,
                                                java.lang.String defaultFile)
Factory method to create a new save dialog box using the default EFileFilter.

Parameters:
types - the types of file. Defaults to ANY if null.
title - dialog title to use; if null uses "Write 'filetype'".
defaultFile - default file name to write.

getOpenFileType

public static FileType getOpenFileType(java.lang.String libName,
                                       FileType def)
Method to determine OpenFile type based on extension

Parameters:
libName -
Returns:
OpenFile.Type extension