|
Java Platform 1.2 Beta 4 |
|||||||||
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 | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JFileChooser
Inner Class Summary | |
protected | JFileChooser.AccessibleJFileChooser
The class used to obtain the accessible context for this object. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Fields inherited from class com.sun.java.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 |
Constructor Summary | |
JFileChooser()
Creates a JFileChooser pointing to the user's home directory. |
|
JFileChooser(File currentDirectory,
com.sun.java.swing.filechooser.FileSystemView fileSystemView)
Creates a JFileChooser using the given current directory and FileSystemView |
|
JFileChooser(File currentDirectory)
Creates a JFileChooser using the given File as the path. |
|
JFileChooser(com.sun.java.swing.filechooser.FileSystemView fileSystemView)
Creates a JFileChooser using the given FileSystemView |
|
JFileChooser(String currentDirectoryPath,
com.sun.java.swing.filechooser.FileSystemView fileSystemView)
Creates a JFileChooser using the given current directory path and FileSystemView |
|
JFileChooser(String currentDirectoryPath)
Creates a JFileChooser using the given path. |
Method Summary | |
boolean | accept(File f)
|
void | addActionListener(ActionListener l)
adds an ActionListener to the button |
void | addChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter filter)
Adds a filter to the list of user choosable file filters. |
void | approveSelection()
Called by the UI when the user hits the approve (AKA "Open" or "Save") button. |
void | cancelSelection()
Called by the UI when the user hits the cancel button. |
void | changeToParentDirectory()
Changes the directory to be set to the parent of the current directory. |
void | ensureFileIsVisible(File f)
|
protected void | fireActionPerformed(String command)
Notify all listeners that have registered interest for notification on this event type. |
com.sun.java.swing.filechooser.FileFilter | getAcceptAllFileFilter()
Returns the AcceptAll file filter (e.g. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JFileChooser |
JComponent | getAccessory()
Return the accessory component. |
int | getApproveButtonMnemonic()
Returns the approve button's mnemonic. |
String | getApproveButtonText()
Returns the text used in the ApproveButton in the FileChooserUI. If null, the UI object will determine the button's text. |
String | getApproveButtonToolTipText()
Returns the tooltip text used in the ApproveButton. |
com.sun.java.swing.filechooser.FileFilter[] | getChoosableFileFilters()
Gets the list of user choosable file filters |
File | getCurrentDirectory()
Returns the current directory. |
String | getDescription(File f)
|
String | getDialogTitle()
Gets the string that goes in the FileChooser's titlebar. |
int | getDialogType()
Returns the type of this dialog. |
com.sun.java.swing.filechooser.FileFilter | getFileFilter()
Returns the currently selected file filter. |
int | getFileSelectionMode()
|
com.sun.java.swing.filechooser.FileSystemView | getFileSystemView()
|
com.sun.java.swing.filechooser.FileView | getFileView()
Returns the current file view. |
Icon | getIcon(File f)
|
String | getName(File f)
|
File | getSelectedFile()
Returns the selected file. |
File[] | getSelectedFiles()
Returns a list of selected files if the filechooser is set to allow multi-selection. |
String | getTypeDescription(File f)
|
FileChooserUI | getUI()
Gets the UI object which implements the L&F for this component. |
String | getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component. |
boolean | isDirectorySelectionEnabled()
Convenience call that determines if directories are selectable based on the current file selection mode |
boolean | isFileHidingEnabled()
If true, hidden files are not shown in the filechooser |
boolean | isFileSelectionEnabled()
Convenience call that determines if files are selectable based on the current file selection mode |
boolean | isMultiSelectionEnabled()
|
boolean | isTraversable(File f)
|
void | removeActionListener(ActionListener l)
removes an ActionListener from the button |
boolean | removeChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter f)
Removes a filter from the list of user choosable file filters. |
void | rescanCurrentDirectory()
Tells the UI to rescan it's files list from the current directory. |
void | resetChoosableFileFilters()
Resets the choosable file filter list to it's starting state. |
void | setAccessory(JComponent newAccessory)
Sets the accessory component. |
void | setApproveButtonMnemonic(char mnemonic)
|
void | setApproveButtonMnemonic(int mnemonic)
Sets the approve button's mnemonic. |
void | setApproveButtonText(String approveButtonText)
Sets the text used in the ApproveButton in the FileChooserUI. |
void | setApproveButtonToolTipText(String toolTipText)
Sets the tooltip text used in the ApproveButton. |
void | setCurrentDirectory(File dir)
Sets the current directory. |
void | setDialogTitle(String dialogTitle)
Sets the string that goes in the FileChooser window's title bar. |
void | setDialogType(int dialogType)
Sets the type of this dialog. |
void | setFileFilter(com.sun.java.swing.filechooser.FileFilter filter)
Sets the current File Filter. |
void | setFileHidingEnabled(boolean b)
Sets file hiding on or off. |
void | setFileSelectionMode(int mode)
Sets the FileChooser to allow the user to just select files, just select directories, or select both files and directetories. |
void | setFileSystemView(com.sun.java.swing.filechooser.FileSystemView fileSystemView)
Sets the file system view which the JFileChooser uses to access and create file system resouces, such as finding the floppy drive and getting a list of root drives. |
void | setFileView(com.sun.java.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 b)
Sets the filechooser to allow multiple file selections. |
void | setSelectedFile(File selectedFile)
Sets the selected file. |
void | setSelectedFiles(File[] selectedFiles)
Sets the list of selected files if the filechooser is set to allow multi-selection. |
protected void | setup(com.sun.java.swing.filechooser.FileSystemView view)
Perform common constructor initialization and setup |
int | showDialog(Component parent,
String approveButtonText)
Pops a custom file chooser dialog with a custom ApproveButton. e.g. filechooser.showDialog(parentWindow, "Run Application"); would pop up a filechooser with a "Run Application" button (instead of the normal "Save" or "Open" button). |
int | showOpenDialog(Component parent)
Pops up an "Open File" file chooser dialog. |
int | showSaveDialog(Component parent)
Pops up a "Save File" file chooser dialog. |
void | updateUI()
Notification from the UIFactory that the L&F has changed. |
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 , paramString , preferredSize , print , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , setLayout , validate , validateTree |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
Field Detail |
public static final int OPEN_DIALOG
public static final int SAVE_DIALOG
public static final int CUSTOM_DIALOG
public static final int CANCEL_OPTION
public static final int APPROVE_OPTION
public static final int ERROR_OPTION
public static final int FILES_ONLY
public static final int DIRECTORIES_ONLY
public static final int FILES_AND_DIRECTORIES
public static final String CANCEL_SELECTION
public static final String APPROVE_SELECTION
public static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
public static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
public static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
public static final String DIRECTORY_CHANGED_PROPERTY
public static final String SELECTED_FILE_CHANGED_PROPERTY
public static final String SELECTED_FILES_CHANGED_PROPERTY
public static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
public static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY
public static final String FILE_VIEW_CHANGED_PROPERTY
public static final String FILE_HIDING_CHANGED_PROPERTY
public static final String FILE_FILTER_CHANGED_PROPERTY
public static final String FILE_SELECTION_MODE_CHANGED_PROPERTY
public static final String ACCESSORY_CHANGED_PROPERTY
public static final String DIALOG_TITLE_CHANGED_PROPERTY
public static final String DIALOG_TYPE_CHANGED_PROPERTY
public static final String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
protected AccessibleContext accessibleContext
Constructor Detail |
public JFileChooser()
public JFileChooser(String currentDirectoryPath)
path
- a String giving the path to a file or directorypublic JFileChooser(File currentDirectory)
directory
- a File object specifying the path to a file
or directorypublic JFileChooser(com.sun.java.swing.filechooser.FileSystemView fileSystemView)
public JFileChooser(File currentDirectory, com.sun.java.swing.filechooser.FileSystemView fileSystemView)
public JFileChooser(String currentDirectoryPath, com.sun.java.swing.filechooser.FileSystemView fileSystemView)
Method Detail |
protected void setup(com.sun.java.swing.filechooser.FileSystemView view)
public File getSelectedFile()
setSelectedFile(java.io.File)
public void setSelectedFile(File selectedFile)
selectedFile
- the selected filepublic File[] getSelectedFiles()
public void setSelectedFiles(File[] selectedFiles)
public File getCurrentDirectory()
setCurrentDirectory(java.io.File)
public void setCurrentDirectory(File dir)
currentDirectory
- the current directory to point togetCurrentDirectory()
public void changeToParentDirectory()
getCurrentDirectory()
public void rescanCurrentDirectory()
public void ensureFileIsVisible(File f)
public int showOpenDialog(Component parent)
public int showSaveDialog(Component parent)
public int showDialog(Component parent, String approveButtonText)
approveButtonText
- the text of the ApproveButtonpublic int getDialogType()
setDialogType(int)
public void setDialogType(int dialogType)
dialogType
- the type of dialog to be displayed:
OPEN_DIALOG, SAVE_DIALOG, CUSTOM_DIALOGgetDialogType()
,
setApproveButtonText(java.lang.String)
public void setDialogTitle(String dialogTitle)
getDialogTitle()
public String getDialogTitle()
setDialogTitle(java.lang.String)
public void setApproveButtonToolTipText(String toolTipText)
setApproveButtonText(java.lang.String)
,
setDialogType(int)
,
showDialog(java.awt.Component, java.lang.String)
public String getApproveButtonToolTipText()
setApproveButtonText(java.lang.String)
,
setDialogType(int)
,
showDialog(java.awt.Component, java.lang.String)
public int getApproveButtonMnemonic()
setApproveButtonMnemonic(int)
public void setApproveButtonMnemonic(int mnemonic)
setApproveButtonMnemonic(int)
public void setApproveButtonMnemonic(char mnemonic)
public void setApproveButtonText(String approveButtonText)
approveButtonText
- the text used in the ApproveButtongetApproveButtonText()
,
setDialogType(int)
,
showDialog(java.awt.Component, java.lang.String)
public String getApproveButtonText()
setApproveButtonText(java.lang.String)
,
setDialogType(int)
,
showDialog(java.awt.Component, java.lang.String)
public com.sun.java.swing.filechooser.FileFilter[] getChoosableFileFilters()
public void addChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter filter)
filter
- the FileFilter to add to the choosable file
filter listpublic boolean removeChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter f)
public void resetChoosableFileFilters()
addChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter)
,
#getChoosableFileFilter
,
removeChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter)
public com.sun.java.swing.filechooser.FileFilter getAcceptAllFileFilter()
public JComponent getAccessory()
setAccessory(com.sun.java.swing.JComponent)
public void setAccessory(JComponent newAccessory)
public void setFileSelectionMode(int mode)
dialogType
- the type of dialog to be displayed:
FILES_ONLY, DIRECTORIES_ONLY, FILES_AND_DIRECTORIESgetFileSelectionMode()
public int getFileSelectionMode()
setFileSelectionMode(int)
public boolean isFileSelectionEnabled()
setFileSelectionMode(int)
,
getFileSelectionMode()
public boolean isDirectorySelectionEnabled()
setFileSelectionMode(int)
,
getFileSelectionMode()
public void setMultiSelectionEnabled(boolean b)
isMultiSelectionEnabled()
public boolean isMultiSelectionEnabled()
setMultiSelectionEnabled(boolean)
public boolean isFileHidingEnabled()
setFileHidingEnabled(boolean)
public void setFileHidingEnabled(boolean b)
b
- the boolean value that determines whether file hiding is
turned on or not.isFileHidingEnabled()
public void setFileFilter(com.sun.java.swing.filechooser.FileFilter filter)
filter
- the new current file filter to use#getFilefilter
public com.sun.java.swing.filechooser.FileFilter getFileFilter()
setFileFilter(com.sun.java.swing.filechooser.FileFilter)
,
addChoosableFileFilter(com.sun.java.swing.filechooser.FileFilter)
public void setFileView(com.sun.java.swing.filechooser.FileView fileView)
getFileView()
public com.sun.java.swing.filechooser.FileView getFileView()
setFileView(com.sun.java.swing.filechooser.FileView)
public String getName(File f)
FileView.getName(java.io.File)
public String getDescription(File f)
FileView.getDescription(java.io.File)
public String getTypeDescription(File f)
FileView.getTypeDescription(java.io.File)
public Icon getIcon(File f)
FileView#getIconDescription
public boolean isTraversable(File f)
FileView.isTraversable(java.io.File)
public boolean accept(File f)
FileFilter.accept(java.io.File)
public void setFileSystemView(com.sun.java.swing.filechooser.FileSystemView fileSystemView)
FileSystemView
public com.sun.java.swing.filechooser.FileSystemView getFileSystemView()
setfileSystemView
public void approveSelection()
public void cancelSelection()
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
protected void fireActionPerformed(String command)
EventListenerList
public void updateUI()
JComponent.updateUI()
public String getUIClassID()
JComponent.getUIClassID()
,
UIDefaults.getUI(com.sun.java.swing.JComponent)
public FileChooserUI getUI()
public AccessibleContext getAccessibleContext()
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |