|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
nrs.util.file.FileDialog
Extended AWT file dialog with support for selecting multiple files and adding extra components to the borders of the dialog.
| Nested Class Summary |
| Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static int |
OPEN
|
static int |
SAVE
|
| 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 | |
FileDialog(java.awt.Frame owner)
Creates a new instance of FileDialog |
|
FileDialog(java.awt.Frame owner,
java.lang.String title)
|
|
FileDialog(java.awt.Frame owner,
java.lang.String title,
int mode)
|
|
FileDialog(java.awt.Frame owner,
java.lang.String title,
int mode,
java.awt.Component[] comps)
|
|
| Method Summary | |
boolean |
accept(java.io.File dir,
java.lang.String name)
Implementation method for FilenameFilter |
void |
actionPerformed(java.awt.event.ActionEvent e)
User clicked a button |
void |
addBorderPanel(java.awt.Panel panel,
java.lang.String constraint)
Add a panel containing components to one of the borders of the FileDialog |
void |
addFileFilter(java.lang.String displayName,
java.lang.String ending)
Add a file filter |
void |
addFileSelectionListener(FileSelectionListener listener)
Add a file selection listener |
void |
componentHidden(java.awt.event.ComponentEvent arg0)
|
void |
componentMoved(java.awt.event.ComponentEvent arg0)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent arg0)
|
java.lang.String |
getCancelButtonLabel()
Get the text of the Cancel button |
java.awt.Dimension |
getMinimumSize()
|
java.lang.String |
getOKButtonLabel()
Get the text of the OK button |
java.awt.Dimension |
getPreferredSize()
|
java.io.File[] |
getSelectedFiles()
Get the list of files selected by the user |
boolean |
isSelectDirectories()
Return whether directories can be selected |
boolean |
isSelectMultiple()
Return the current selection mode |
void |
itemStateChanged(java.awt.event.ItemEvent e)
User selected a file type or directory |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
protected void |
notifyFileSelectionListeners()
Notify listeners of any changes |
void |
removeFileSelectionListener(FileSelectionListener listener)
Remove a file selection listener |
void |
setCancelButtonLabel(java.lang.String label)
Set the text of the Cancel button |
void |
setOKButtonLabel(java.lang.String label)
Set the text of the OK button |
void |
setSelectDirectories(boolean selectDirs)
Sets whether the user can select directories as well as files |
void |
setSelectedDirectory(java.io.File dir)
Set the selected directory |
void |
setSelectedFile(java.io.File f)
Set the selected file |
void |
setSelectedFileFilter(java.lang.String extension)
Set the selected file filter |
void |
setSelectMultiple(boolean multiple)
Set whether the user can select either one or multiple files. |
void |
windowActivated(java.awt.event.WindowEvent e)
Invoked when the Window is set to be the active Window. |
void |
windowClosed(java.awt.event.WindowEvent e)
Invoked when a window has been closed as the result of calling dispose on the window. |
void |
windowClosing(java.awt.event.WindowEvent e)
Invoked when the user attempts to close the window from the window's system menu. |
void |
windowDeactivated(java.awt.event.WindowEvent e)
Invoked when a Window is no longer the active Window. |
void |
windowDeiconified(java.awt.event.WindowEvent e)
Invoked when a window is changed from a minimized to a normal state. |
void |
windowIconified(java.awt.event.WindowEvent e)
Invoked when a window is changed from a normal to a minimized state. |
void |
windowOpened(java.awt.event.WindowEvent e)
Invoked the first time a window is made visible. |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int OPEN
public static final int SAVE
| Constructor Detail |
public FileDialog(java.awt.Frame owner)
public FileDialog(java.awt.Frame owner,
java.lang.String title)
public FileDialog(java.awt.Frame owner,
java.lang.String title,
int mode)
public FileDialog(java.awt.Frame owner,
java.lang.String title,
int mode,
java.awt.Component[] comps)
| Method Detail |
public java.io.File[] getSelectedFiles()
protected void notifyFileSelectionListeners()
public void setSelectedDirectory(java.io.File dir)
dir - selected directorypublic void setSelectedFile(java.io.File f)
f - the file to selectpublic void setSelectedFileFilter(java.lang.String extension)
extension - e.g. jar or mp3public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListener
public boolean accept(java.io.File dir,
java.lang.String name)
accept in interface java.io.FilenameFilterpublic void setSelectMultiple(boolean multiple)
multiple - true if user can select multiple filespublic boolean isSelectMultiple()
public void setSelectDirectories(boolean selectDirs)
selectDirs - public boolean isSelectDirectories()
public void addFileFilter(java.lang.String displayName,
java.lang.String ending)
displayName - e.g. HTML (*.html)ending - e.g. htm, htmlpublic void addFileSelectionListener(FileSelectionListener listener)
listener - object that wants to receive file selection eventspublic void removeFileSelectionListener(FileSelectionListener listener)
listener - the listener to be removed
public void addBorderPanel(java.awt.Panel panel,
java.lang.String constraint)
panel - the Panel to addconstraint - one of BorderLayout.EAST, BorderLayout.WEST, BorderLayout.NORTH, BorderLayout.SOUTHpublic java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public void componentHidden(java.awt.event.ComponentEvent arg0)
componentHidden in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent arg0)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentShown(java.awt.event.ComponentEvent arg0)
componentShown in interface java.awt.event.ComponentListenerpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void setOKButtonLabel(java.lang.String label)
label - the label to set on the OK buttonpublic void setCancelButtonLabel(java.lang.String label)
label - the label to set on the Cancel buttonpublic java.lang.String getOKButtonLabel()
public java.lang.String getCancelButtonLabel()
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified in interface java.awt.event.WindowListenerFrame.setIconImage(java.awt.Image)public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated in interface java.awt.event.WindowListenerpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenerpublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed in interface java.awt.event.WindowListenerpublic void windowActivated(java.awt.event.WindowEvent e)
windowActivated in interface java.awt.event.WindowListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||