|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.sygem.swing.jdirectorychooser.JDirectoryChooser
The JDirectoryChooser represents a simpler way for users to
select directories than using the JFileChooser. It more closely
resembles a native platform directory chooser.
The chooser also supports the ability to create new directories, and rename those newly created directories.
Title: JDirectoryChooser
Description: A Swing component for selecting directories
Copyright: Copyright (c) 2004
Company: SyGem Software
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Field Summary | |
static int |
APPROVE_OPTION
Return value if approve (yes, ok) is chosen. |
static int |
CANCEL_OPTION
Return value if cancel is chosen. |
static java.lang.String |
DIRECTORY_CHANGED_PROPERTY
Identifies user's directory change. |
static int |
ERROR_OPTION
Return value if an error occured. |
static java.lang.String |
FILE_SYSTEM_VIEW_CHANGED_PROPERTY
Says that a different object is being used to find available drives on the system. |
| Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, 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()
Constructs a JDirectoryChooser object, using the default FileSystemView. |
|
JDirectoryChooser(java.io.File currentDirectory)
Constructs a JDirectoryChooser object, using the default FileSystemView but pointing at the given directory. |
|
JDirectoryChooser(java.io.File currentDirectory,
javax.swing.filechooser.FileSystemView fsv)
Constructs a JDirectoryChooser using the given current directory
and FileSystemView. |
|
JDirectoryChooser(javax.swing.filechooser.FileSystemView fsv)
Constructs a JDirectoryChooser object, using the specified
FileSystemView. |
|
JDirectoryChooser(java.lang.String currentDirectoryPath)
Constructs a JDirectoryChooser using the given directory path. |
|
JDirectoryChooser(java.lang.String currentDirectoryPath,
javax.swing.filechooser.FileSystemView fsv)
Constructs a JDirectoryChooser using the given current directory
and FileSystemView. |
|
| Method Summary | |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this JDirectoryChooser. |
char |
getCancelButtonMnemonic()
Returns the mnemonic for the "Cancel" button. |
java.lang.String |
getCancelButtonText()
Gets the text used for the "Cancel" button |
java.lang.String |
getCancelButtonToolTipText()
Gets the tool tip used for the "Cancel" button |
java.io.File |
getCurrentDirectory()
Returns the current directory. |
javax.swing.filechooser.FileSystemView |
getFileSystemView()
Returns the file system view. |
char |
getMakeDirectoryButtonMnemonic()
Gets the mnemonic used for the "Make Directory" button |
java.lang.String |
getMakeDirectoryButtonText()
Gets the text used for the "Make Directory" button |
java.lang.String |
getMakeDirectoryButtonToolTipText()
Gets the tool tip text from the "Make Directory" button |
java.lang.String |
getMessageText()
Gets the message displayed at the top of the directory chooser dialog. |
char |
getOkButtonMnemonic()
Returns the mnemonic for the "OK" button. |
java.lang.String |
getOkButtonText()
Gets the text used for the "OK" button |
java.lang.String |
getOkButtonToolTipText()
Gets the tool tip text from the "OK" button. |
java.lang.String |
getTitle()
Gets the window title of the directory chooser dialog. |
void |
setCancelButtonMnemonic(char cancelButtonMnemonic)
Sets the mnemonic for the "Cancel" button. |
void |
setCancelButtonText(java.lang.String cancelButtonText)
Sets the text used for the "Cancel" button |
void |
setCancelButtonToolTipText(java.lang.String cancelButtonToolTipText)
Sets the tool tip text for the "Cancel" button |
void |
setCurrentDirectory(java.io.File dir)
Sets the current directory. |
void |
setFileSystemView(javax.swing.filechooser.FileSystemView fsv)
Sets the file system view that the JDirectoryChooser uses for
accessing and creating file system resources, such as finding
the floppy drive and getting a list of root drives. |
void |
setMakeDirectoryButtonMnemonic(char makeDirectoryButtonMnemonic)
Sets the mnemonic used for the "Make Directory" button |
void |
setMakeDirectoryButtonText(java.lang.String makeDirectoryButtonText)
Sets the text used for the "Make Directory" button |
void |
setMakeDirectoryButtonToolTipText(java.lang.String makeDirectoryButtonToolTipText)
Sets the tool tip text for the "Make Directory" button |
void |
setMessageText(java.lang.String messageText)
Sets the message used at the top of the directory chooser dialog. |
void |
setOkButtonMnemonic(char okButtonMnemonic)
Sets the mnemonic for the "OK" button. |
void |
setOkButtonText(java.lang.String okButtonText)
Sets the text for the "OK" button. |
void |
setOkButtonToolTipText(java.lang.String okButtonToolTipText)
Sets the tool tip text for the "OK" button. |
void |
setTitle(java.lang.String title)
Sets the window title of the directory chooser dialog. |
int |
showDialog(java.awt.Component parent)
Pops up the directory chooser dialog. |
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int APPROVE_OPTION
public static final int CANCEL_OPTION
public static final java.lang.String DIRECTORY_CHANGED_PROPERTY
public static final int ERROR_OPTION
public static final java.lang.String FILE_SYSTEM_VIEW_CHANGED_PROPERTY
| Constructor Detail |
public JDirectoryChooser()
public JDirectoryChooser(java.io.File currentDirectory)
currentDirectory - A file representing the initial directory for the chooser
public JDirectoryChooser(java.io.File currentDirectory,
javax.swing.filechooser.FileSystemView fsv)
JDirectoryChooser using the given current directory
and FileSystemView. Assuming the directory exists, the path to
it will be fully opened. If it does not exist, the path will be opened as far
as is possible.
currentDirectory - A file representing the initial directory for the chooserfsv - The FileSystemView object to use for the chooserpublic JDirectoryChooser(javax.swing.filechooser.FileSystemView fsv)
JDirectoryChooser object, using the specified
FileSystemView.
The initial directory will be the root of your system.
fsv - The FileSystemView object to use for the chooserpublic JDirectoryChooser(java.lang.String currentDirectoryPath)
JDirectoryChooser using the given directory path.
Assuming the directory exists, the path to
it will be fully opened. If it does not exist, the path will be opened as far
as is possible.
currentDirectoryPath - The initial directory to open
public JDirectoryChooser(java.lang.String currentDirectoryPath,
javax.swing.filechooser.FileSystemView fsv)
JDirectoryChooser using the given current directory
and FileSystemView. Assuming the directory exists, the path to
it will be fully opened. If it does not exist, the path will be opened as far
as is possible.
currentDirectoryPath - The initial directory to openfsv - FileSystemView| Method Detail |
public javax.accessibility.AccessibleContext getAccessibleContext()
getAccessibleContext in interface javax.accessibility.Accessiblepublic char getCancelButtonMnemonic()
public java.lang.String getCancelButtonText()
public java.lang.String getCancelButtonToolTipText()
public java.io.File getCurrentDirectory()
setCurrentDirectory(java.io.File)public javax.swing.filechooser.FileSystemView getFileSystemView()
FileSystemView objectsetFileSystemView(javax.swing.filechooser.FileSystemView)public char getMakeDirectoryButtonMnemonic()
public java.lang.String getMakeDirectoryButtonText()
public java.lang.String getMakeDirectoryButtonToolTipText()
public java.lang.String getMessageText()
public char getOkButtonMnemonic()
public java.lang.String getOkButtonText()
public java.lang.String getOkButtonToolTipText()
public java.lang.String getTitle()
public void setCancelButtonMnemonic(char cancelButtonMnemonic)
cancelButtonMnemonic - a charpublic void setCancelButtonText(java.lang.String cancelButtonText)
cancelButtonText - The new button textpublic void setCancelButtonToolTipText(java.lang.String cancelButtonToolTipText)
cancelButtonToolTipText - The new tool tippublic void setCurrentDirectory(java.io.File dir)
null performs
no action on the JDirectoryChooser.
If the file passed in as currentDirectory is not a
directory, the parent of the file will be used as the currentDirectory.
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.
dir - the current directory to point togetCurrentDirectory()public void setFileSystemView(javax.swing.filechooser.FileSystemView fsv)
JDirectoryChooser uses for
accessing and creating file system resources, such as finding
the floppy drive and getting a list of root drives.
fsv - the new FileSystemViewFileSystemViewpublic void setMakeDirectoryButtonMnemonic(char makeDirectoryButtonMnemonic)
makeDirectoryButtonMnemonic - The new mnemonicpublic void setMakeDirectoryButtonText(java.lang.String makeDirectoryButtonText)
makeDirectoryButtonText - The new button textpublic void setMakeDirectoryButtonToolTipText(java.lang.String makeDirectoryButtonToolTipText)
makeDirectoryButtonToolTipText - The new tool tippublic void setMessageText(java.lang.String messageText)
messageText - The new messagepublic void setOkButtonMnemonic(char okButtonMnemonic)
okButtonMnemonic - a charpublic void setOkButtonText(java.lang.String okButtonText)
okButtonText - The new button textpublic void setOkButtonToolTipText(java.lang.String okButtonToolTipText)
okButtonToolTipText - The new tool tip textpublic void setTitle(java.lang.String title)
title - The new title for the dialogpublic int showDialog(java.awt.Component parent)
parent - the parent component of the dialog,
can be null;
java.awt.HeadlessException - if GraphicsEnvironment.isHeadless()
returns true.GraphicsEnvironment.isHeadless()public void updateUI()
JComponent.updateUI()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||