|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent org.freehep.swing.JDirectoryChooser
A class which allows a user to select directories or files, similar to JFileChooser, except that it display files as a tree, and is better suited to selecting directories than the current file chooser (see java bug id 4239219). TODO: Understand issue with moving mouse between double clicks (seems like MOUSE_PRESSED and MOUSE_RELEASED events are generated, but not MOUSE_CLICKED) See Bug ID 4218549
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
static int |
APPROVE_OPTION
|
static int |
CANCEL_OPTION
|
static int |
DIRECTORIES_ONLY
|
static int |
FILES_AND_DIRECTORIES
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JDirectoryChooser()
Create a JDirectoryChooser with the default FileSystemView |
|
JDirectoryChooser(File currentDirectory)
Create a JDirectoryChooser with the default FileSystemView |
|
JDirectoryChooser(File currentDirectory,
FileSystemView view)
Create a JDirectoryChooser |
|
JDirectoryChooser(FileSystemView view)
Create a JDirectoryChooser |
|
JDirectoryChooser(String currentDirectory)
Create a JDirectoryChooser with the default FileSystemView |
|
JDirectoryChooser(String currentDirectory,
FileSystemView view)
Create a JDirectoryChooser |
Method Summary | |
void |
addNotify()
|
String |
getDialogTitle()
Gets the string that goes in the FileChooser's titlebar |
FileFilter |
getFileFilter()
Get the current file filter |
int |
getFileSelectionMode()
Test the file selection mode |
FileView |
getFileView()
Returns the current file view. |
File |
getSelectedFile()
Returns the currently selected file (or the first selected file if multiple files are selected) |
File[] |
getSelectedFiles()
Returns a list of selected files if the filechooser is set to allow multi-selection. |
boolean |
isFileHidingEnabled()
Test if file hiding is enabled |
boolean |
isMultiSelectionEnabled()
Returns true if multi-file selection is enabled. |
static void |
main(String[] argv)
|
void |
setCurrentDirectory(File dir)
Set the directory to which the tree is to open |
void |
setDialogTitle(String dialogTitle)
Sets the string that goes in the FileChooser window's title bar |
void |
setFileFilter(FileFilter fileFilter)
Set a filter to control which files are displayed in the tree |
void |
setFileHidingEnabled(boolean hide)
Select whether to show "hidden" files in the tree |
void |
setFileSelectionMode(int mode)
Set the file selection mode. |
void |
setFileView(FileView fileView)
Sets the file view to used to retrieve UI information, such as the icon that represents a file or the type description of a file. |
void |
setMultiSelectionEnabled(boolean enable)
Sets the filechooser to allow multiple file selections. |
protected void |
setup(FileSystemView view)
|
int |
showDialog(Component parent)
Popup up a modal dialog containing the JDirectoryChooser |
void |
updateUI()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int APPROVE_OPTION
public static final int CANCEL_OPTION
public static final int DIRECTORIES_ONLY
public static final int FILES_AND_DIRECTORIES
Constructor Detail |
public JDirectoryChooser()
public JDirectoryChooser(File currentDirectory)
currentDirectory
- The directory to which the tree is initially setpublic JDirectoryChooser(String currentDirectory)
currentDirectory
- The directory to which the tree is initially setpublic JDirectoryChooser(File currentDirectory, FileSystemView view)
currentDirectory
- The directory to which the tree is initially setview
- The FileSystemView to usepublic JDirectoryChooser(String currentDirectory, FileSystemView view)
currentDirectory
- The directory to which the tree is initially setview
- The FileSystemView to usepublic JDirectoryChooser(FileSystemView view)
view
- The FileSystemView to useMethod Detail |
public void addNotify()
public void setCurrentDirectory(File dir)
public void setFileFilter(FileFilter fileFilter)
public FileFilter getFileFilter()
public void setFileHidingEnabled(boolean hide)
hide
- True if hidden files should not be shownpublic boolean isFileHidingEnabled()
setFileHidingEnabled(boolean)
public void setFileSelectionMode(int mode)
mode
- either DIRECTORIES_ONLY or FILES_AND_DIRECTORIES (the default)JFileChooser.setFileSelectionMode(int)
public int getFileSelectionMode()
setFileSelectionMode(int)
public void setMultiSelectionEnabled(boolean enable)
public boolean isMultiSelectionEnabled()
public File getSelectedFile()
public File[] getSelectedFiles()
protected void setup(FileSystemView view)
public void updateUI()
public int showDialog(Component parent)
parent
- The parent of the dialog box
JFileChooser.showDialog(java.awt.Component, java.lang.String)
public void setDialogTitle(String dialogTitle)
public String getDialogTitle()
public void setFileView(FileView fileView)
public FileView getFileView()
public static void main(String[] argv) throws Exception
Exception
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |