net.sf.doolin.gui.swing
Class FileBrowser

java.lang.Object
  extended by net.sf.doolin.gui.swing.FileBrowser

public class FileBrowser
extends Object

This class allows the browsing of files or directories.

Author:
Damien Coraboeuf

Constructor Summary
FileBrowser()
          Constructor with no support for preferences
FileBrowser(GUIPreferences preferences)
          Constructor with support for preferences
 
Method Summary
 File browse(Component component)
          Browses for a file or a directory.
 String getFileDescription()
          Returns the file description.
 String getFileFilter()
          Gets the file filter.
 boolean isModeDirectory()
          Gets if the browsing is addressing only directories.
 boolean isModeSave()
          Gets the browsing mode.
 void setFile(File f)
          Set the initial file
 void setFileDescription(String fileDescription)
          Sets the file description.
 void setFileFilter(String fileFilter)
          Sets the file filter.
 void setModeDirectory(boolean modeDirectory)
          Sets if the browsing is addressing only directories.
 void setModeSave(boolean modeSave)
          Sets the browsing mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBrowser

public FileBrowser()
Constructor with no support for preferences


FileBrowser

public FileBrowser(GUIPreferences preferences)
Constructor with support for preferences

Parameters:
preferences - Preference
Method Detail

browse

public File browse(Component component)
Browses for a file or a directory. This method launches a file browser.

Parameters:
component - Parent component for the file browser dialog
Returns:
Selected file or directory or null if none has been selected.

getFileDescription

public String getFileDescription()
Returns the file description.

Returns:
File description.

getFileFilter

public String getFileFilter()
Gets the file filter.

Returns:
File filter.
See Also:
PatternFileFilter

isModeDirectory

public boolean isModeDirectory()
Gets if the browsing is addressing only directories.

Returns:
true if only directories are browsed.

isModeSave

public boolean isModeSave()
Gets the browsing mode.

Returns:
true if files/directories are to be saved, false if they have to be opened.

setFile

public void setFile(File f)
Set the initial file

Parameters:
f - Initial selection

setFileDescription

public void setFileDescription(String fileDescription)
Sets the file description.

Parameters:
fileDescription - File description

setFileFilter

public void setFileFilter(String fileFilter)
Sets the file filter.

Parameters:
fileFilter - File filter.
See Also:
PatternFileFilter

setModeDirectory

public void setModeDirectory(boolean modeDirectory)
Sets if the browsing is addressing only directories.

Parameters:
modeDirectory - true if only directories are browsed

setModeSave

public void setModeSave(boolean modeSave)
Sets the browsing mode.

Parameters:
modeSave - true if files/directories are to be saved, false if they have to be opened.


Copyright © 2011. All Rights Reserved.