com.togethersoft.openapi.ide.window
Interface IdePathChooser

All Known Subinterfaces:
IdeFileChooser

public interface IdePathChooser

IdePathChooser provides a simple mechanism for the user to choose a path.

Author:
TogetherSoft
Since: Together 5.0

Method Summary
 StringgetApproveButtonText()
          Returns the text used in the ApproveButton in the FileChooserUI.
 FilegetCurrentDirectory()
          Returns the current directory.
 StringgetDialogTitle()
          Gets the string displayed in the FileChooser's titlebar.
 FileFiltergetFileFilter()
          Returns the currently selected file filter.
 intgetFileSelectionMode()
          Returns the current file-selection mode.
 FilegetSelectedFile()
          Returns the selected file.
 File[]getSelectedFiles()
          Returns a list of selected files if the file chooser is set to allow multiple selection.
 booleanisFileHidingEnabled()
           
 booleanisMultiSelectionEnabled()
          Returns true if multiple files can be selected.
 voidsetApproveButtonText(String approveButtonText)
          Sets specified text for the ApproveButton in the FileChooserUI.
 voidsetCurrentDirectory(File dir)
          Sets the current directory.
 voidsetDialogTitle(String dialogTitle)
          Sets specified string to be displayed in the FileChooser window's title bar.
 voidsetFileFilter(FileFilter filter)
          Sets the current File Filter.
 voidsetFileHidingEnabled(boolean b)
          Sets file hiding on or off.
 voidsetFileSelectionMode(int mode)
          Sets the FileChooser to allow the user to select only files, to select
only directories, or to select both files and directories.
 voidsetMultiSelectionEnabled(boolean b)
          Sets the file chooser to allow multiple file selections.
 voidsetSelectedFile(File selectedFile)
          Sets the selected file.
 voidsetSelectedFiles(File[] selectedFiles)
          Sets the list of selected files if the file chooser is set to allow multiple selection.
 intshowDialog(Component parent)
          Displays the file chooser dialog.

Method Detail

getApproveButtonText

public String getApproveButtonText()
Returns the text used in the ApproveButton in the FileChooserUI.
If null, the UI object will determine the button's text. Typically, this would be "Open" or "Save".
Returns: String text used in the ApproveButton
See Also:
setApproveButtonText(java.lang.String), #setDialogType, showDialog(java.awt.Component)

getCurrentDirectory

public File getCurrentDirectory()
Returns the current directory.
Returns: the current directory
See Also:
setCurrentDirectory(java.io.File)

getDialogTitle

public String getDialogTitle()
Gets the string displayed in the FileChooser's titlebar.
Returns: String title of the file chooser
See Also:
setDialogTitle(java.lang.String)

getFileFilter

public FileFilter getFileFilter()
Returns the currently selected file filter.
Returns: FileFilter object representing the current file filter.
See Also:
setFileFilter(javax.swing.filechooser.FileFilter), #addChoosableFileFilter

getFileSelectionMode

public int getFileSelectionMode()
Returns the current file-selection mode.
Returns: int indicating the type of dialog to be displayed:
FILES_ONLY, DIRECTORIES_ONLY, FILES_AND_DIRECTORIES
See Also:
setFileSelectionMode(int), IdeFileChooserConstant

getSelectedFile

public File getSelectedFile()
Returns the selected file.
Returns: the selected file
See Also:
setSelectedFile(java.io.File)

getSelectedFiles

public File[] getSelectedFiles()
Returns a list of selected files if the file chooser is set to allow multiple selection.

isFileHidingEnabled

public boolean isFileHidingEnabled()

isMultiSelectionEnabled

public boolean isMultiSelectionEnabled()
Returns true if multiple files can be selected.
Returns: true if multiple files can be selected
See Also:
setMultiSelectionEnabled(boolean)

setApproveButtonText

public void setApproveButtonText(String approveButtonText)
Sets specified text for the ApproveButton in the FileChooserUI.
Parameters:
approveButtonText String text used in the ApproveButton
See Also:
getApproveButtonText(), #setDialogType, showDialog(java.awt.Component)

setCurrentDirectory

public void setCurrentDirectory(File dir)
Sets the current directory. Passing in null sets the filechooser to point to the users's home directory.

If the file passed in as dir is not a directory, the
parent of this file will be used as the current directory. If the
parent is not traversable, then it will walk up the parent tree
until it finds a traversable directory, or hits the root of the file system.

Parameters:
dir File object representing the current directory to point to
See Also:
getCurrentDirectory()

setDialogTitle

public void setDialogTitle(String dialogTitle)
Sets specified string to be displayed in the FileChooser window's title bar.
Parameters:
dialogTitle String title of the dialog
See Also:
getDialogTitle()

setFileFilter

public void setFileFilter(FileFilter filter)
Sets the current File Filter. The file filter is used by the
filechooser to filter out files that are visible to the user.
Parameters:
filter the new current file filter to use
See Also:
getFileFilter()

setFileHidingEnabled

public void setFileHidingEnabled(boolean b)
Sets file hiding on or off. If true, hidden files are not shown in the file chooser.

setFileSelectionMode

public void setFileSelectionMode(int mode)
Sets the FileChooser to allow the user to select only files, to select
only directories, or to select both files and directories.
Parameters:
dialogType int type of dialog to be displayed: FILES_ONLY, DIRECTORIES_ONLY, FILES_AND_DIRECTORIES
See Also:
getFileSelectionMode(), IdeFileChooserConstant

setMultiSelectionEnabled

public void setMultiSelectionEnabled(boolean b)
Sets the file chooser to allow multiple file selections.


NOTE: this functionality is not yet implemented in the some L&Fs.

See Also:
isMultiSelectionEnabled()

setSelectedFile

public void setSelectedFile(File selectedFile)
Sets the selected file. If the file's parent directory is not the current directory, it changes the current directory
to be the files parent directory.
Parameters:
selectedFile the selected file
See Also:
getSelectedFile()

setSelectedFiles

public void setSelectedFiles(File[] selectedFiles)
Sets the list of selected files if the file chooser is set to allow multiple selection.

showDialog

public int showDialog(Component parent)
Displays the file chooser dialog. If the Component is not
null, the frame of the Component is used as the parent frame for the dialog box.
Parameters:
parent Component descendant used to determine the parent of the dialog box.
Returns: int state of the filechooser on popdown: CANCEL_OPTION, APPROVE_OPTION
See Also:
IdeFileChooserConstant