|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--jas.util.gui.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
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static int |
APPROVE_OPTION
|
static int |
CANCEL_OPTION
|
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(java.io.File currentDirectory)
Create a JDirectoryChooser with the default FileSystemView |
|
JDirectoryChooser(java.io.File currentDirectory,
javax.swing.filechooser.FileSystemView view)
Create a JDirectoryChooser |
|
JDirectoryChooser(javax.swing.filechooser.FileSystemView view)
Create a JDirectoryChooser |
|
JDirectoryChooser(java.lang.String currentDirectory)
Create a JDirectoryChooser with the default FileSystemView |
|
JDirectoryChooser(java.lang.String currentDirectory,
javax.swing.filechooser.FileSystemView view)
Create a JDirectoryChooser |
Method Summary | |
void |
addNotify()
|
java.lang.String |
getDialogTitle()
Gets the string that goes in the FileChooser's titlebar |
javax.swing.filechooser.FileFilter |
getFileFilter()
Get the current file filter |
int |
getFileSelectionMode()
Test the file selection mode |
javax.swing.filechooser.FileView |
getFileView()
Returns the current file view. |
java.io.File |
getSelectedFile()
Returns the currently selected file (or the first selected file if multiple files are selected) |
java.io.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(java.lang.String[] argv)
|
void |
setCurrentDirectory(java.io.File dir)
Set the directory to which the tree is to open |
void |
setDialogTitle(java.lang.String dialogTitle)
Sets the string that goes in the FileChooser window's title bar |
void |
setFileFilter(javax.swing.filechooser.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(javax.swing.filechooser.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(javax.swing.filechooser.FileSystemView view)
|
int |
showDialog(java.awt.Component parent)
Popup up a modal dialog containing the JDirectoryChooser |
void |
updateUI()
|
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int APPROVE_OPTION
public static int CANCEL_OPTION
Constructor Detail |
public JDirectoryChooser()
public JDirectoryChooser(java.io.File currentDirectory)
currentDirectory
- The directory to which the tree is initially setpublic JDirectoryChooser(java.lang.String currentDirectory)
currentDirectory
- The directory to which the tree is initially setpublic JDirectoryChooser(java.io.File currentDirectory, javax.swing.filechooser.FileSystemView view)
currentDirectory
- The directory to which the tree is initially setview
- The FileSystemView to usepublic JDirectoryChooser(java.lang.String currentDirectory, javax.swing.filechooser.FileSystemView view)
currentDirectory
- The directory to which the tree is initially setview
- The FileSystemView to usepublic JDirectoryChooser(javax.swing.filechooser.FileSystemView view)
view
- The FileSystemView to useMethod Detail |
public void addNotify()
addNotify
in class javax.swing.JComponent
public void setCurrentDirectory(java.io.File dir)
public void setFileFilter(javax.swing.filechooser.FileFilter fileFilter)
public javax.swing.filechooser.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 JFileChooser.DIRECTORIES_ONLY or JFileChooser.FILES_AND_DIRECTORIES (the default)JFileChooser.setFileSelectionMode(int)
public int getFileSelectionMode()
setFileSelectionMode(int)
public void setMultiSelectionEnabled(boolean enable)
public boolean isMultiSelectionEnabled()
public java.io.File getSelectedFile()
public java.io.File[] getSelectedFiles()
protected void setup(javax.swing.filechooser.FileSystemView view)
public void updateUI()
updateUI
in class javax.swing.JComponent
public int showDialog(java.awt.Component parent)
parent
- The parent of the dialog boxJFileChooser.showDialog(java.awt.Component, java.lang.String)
public void setDialogTitle(java.lang.String dialogTitle)
public java.lang.String getDialogTitle()
public void setFileView(javax.swing.filechooser.FileView fileView)
public javax.swing.filechooser.FileView getFileView()
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |