- java.lang.Object
- 
- javax.swing.plaf.ComponentUI
- 
- javax.swing.plaf.FileChooserUI
- 
- javax.swing.plaf.basic.BasicFileChooserUI
 
 
 
- 
- Direct Known Subclasses:
- MetalFileChooserUI
 
 public class BasicFileChooserUI extends FileChooserUI Basic L&F implementation of a FileChooser.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classBasicFileChooserUI.AcceptAllFileFilterAccept all file filter.protected classBasicFileChooserUI.ApproveSelectionActionResponds to an Open or Save requestprotected classBasicFileChooserUI.BasicFileViewA basic file view.protected classBasicFileChooserUI.CancelSelectionActionResponds to a cancel request.protected classBasicFileChooserUI.ChangeToParentDirectoryActionChange to parent directory action.protected classBasicFileChooserUI.DoubleClickListenerA double click listener.protected classBasicFileChooserUI.GoHomeActionActs on the "home" key event or equivalent event.protected classBasicFileChooserUI.NewFolderActionCreates a new folder.protected classBasicFileChooserUI.SelectionListenerA selection listener.protected classBasicFileChooserUI.UpdateActionRescans the files in the current directory
 - 
Field SummaryFields Modifier and Type Field Description protected intcancelButtonMnemonicCancel button mnemonicprotected StringcancelButtonTextCancel button textprotected StringcancelButtonToolTipTextCancel button tool tip textprotected IconcomputerIconComputer iconprotected IcondetailsViewIconDetails view iconprotected IcondirectoryIconDirectory iconprotected intdirectoryOpenButtonMnemonicThe mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected StringdirectoryOpenButtonTextThe label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected StringdirectoryOpenButtonToolTipTextThe tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected IconfileIconFile iconprotected IconfloppyDriveIconFloppy drive iconprotected IconhardDriveIconHard drive iconprotected inthelpButtonMnemonicHelp button mnemonicprotected StringhelpButtonTextHelp button textprotected StringhelpButtonToolTipTextHelp button tool tip textprotected IconhomeFolderIconHome folder iconprotected IconlistViewIconList view iconprotected IconnewFolderIconNew folder iconprotected intopenButtonMnemonicOpen button mnemonicprotected StringopenButtonTextOpen button textprotected StringopenButtonToolTipTextOpen button tool tip textprotected intsaveButtonMnemonicSave button mnemonicprotected StringsaveButtonTextSave button textprotected StringsaveButtonToolTipTextSave button tool tip textprotected intupdateButtonMnemonicUpdate button mnemonicprotected StringupdateButtonTextUpdate button textprotected StringupdateButtonToolTipTextUpdate button tool tip textprotected IconupFolderIconUp folder iconprotected IconviewMenuIconView menu icon
 - 
Constructor SummaryConstructors Constructor Description BasicFileChooserUI(JFileChooser b)Constructs aBasicFileChooserUI.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearIconCache()Clears the icon cache.protected MouseListenercreateDoubleClickListener(JFileChooser fc, JList<?> list)Creates a double click listener.ListSelectionListenercreateListSelectionListener(JFileChooser fc)Creates a list selection listener.protected voidcreateModel()Creates the model.PropertyChangeListenercreatePropertyChangeListener(JFileChooser fc)Creates the property change listener.static ComponentUIcreateUI(JComponent c)Creates aBasicFileChooserUIimplementation for the specified component.FileFiltergetAcceptAllFileFilter(JFileChooser fc)Returns the default accept all file filterJPanelgetAccessoryPanel()Returns the accessory panel.protected JButtongetApproveButton(JFileChooser fc)Returns the approve button.intgetApproveButtonMnemonic(JFileChooser fc)Returns the approve button mnemonic.StringgetApproveButtonToolTipText(JFileChooser fc)Returns the approve button tool tip.ActiongetApproveSelectionAction()Returns an approve selection action.ActiongetCancelSelectionAction()Returns a cancel selection action.ActiongetChangeToParentDirectoryAction()Returns a change to parent directory action.StringgetDialogTitle(JFileChooser fc)Returns the title of this dialogprotected FilegetDirectory()Property to remember the directory that is currently selected in the UI.StringgetDirectoryName()Returns the directory name.JFileChoosergetFileChooser()Returns the file chooser.StringgetFileName()Returns the file name.ActiongetGoHomeAction()Returns a go home action.BasicDirectoryModelgetModel()Returns the model.ActiongetNewFolderAction()Returns a new folder action.ActiongetUpdateAction()Returns an update action.voidinstallComponents(JFileChooser fc)Installs the components.protected voidinstallDefaults(JFileChooser fc)Installs the defaults.protected voidinstallIcons(JFileChooser fc)Installs the icons.protected voidinstallListeners(JFileChooser fc)Installs the listeners.protected voidinstallStrings(JFileChooser fc)Installs the strings.voidinstallUI(JComponent c)Installs the UI.protected booleanisDirectorySelected()Property to remember whether a directory is currently selected in the UI.protected voidsetDirectory(File f)Property to remember the directory that is currently selected in the UI.voidsetDirectoryName(String dirname)Sets the directory name.protected voidsetDirectorySelected(boolean b)Property to remember whether a directory is currently selected in the UI.voidsetFileName(String filename)Sets the file name.voiduninstallComponents(JFileChooser fc)Uninstalls the components.protected voiduninstallDefaults(JFileChooser fc)Uninstalls the defaults.protected voiduninstallIcons(JFileChooser fc)Uninstalls the icons.protected voiduninstallListeners(JFileChooser fc)Uninstalls the listeners.protected voiduninstallStrings(JFileChooser fc)Uninstalls the strings.voiduninstallUI(JComponent c)Uninstalls the UI.- 
Methods declared in class javax.swing.plaf.FileChooserUIensureFileIsVisible, getApproveButtonText, getDefaultButton, getFileView, rescanCurrentDirectory
 - 
Methods declared in class javax.swing.plaf.ComponentUIcontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
 
- 
 
- 
- 
- 
Field Detail- 
directoryIconprotected Icon directoryIcon Directory icon
 - 
fileIconprotected Icon fileIcon File icon
 - 
computerIconprotected Icon computerIcon Computer icon
 - 
hardDriveIconprotected Icon hardDriveIcon Hard drive icon
 - 
floppyDriveIconprotected Icon floppyDriveIcon Floppy drive icon
 - 
newFolderIconprotected Icon newFolderIcon New folder icon
 - 
upFolderIconprotected Icon upFolderIcon Up folder icon
 - 
homeFolderIconprotected Icon homeFolderIcon Home folder icon
 - 
listViewIconprotected Icon listViewIcon List view icon
 - 
detailsViewIconprotected Icon detailsViewIcon Details view icon
 - 
viewMenuIconprotected Icon viewMenuIcon View menu icon
 - 
saveButtonMnemonicprotected int saveButtonMnemonic Save button mnemonic
 - 
openButtonMnemonicprotected int openButtonMnemonic Open button mnemonic
 - 
cancelButtonMnemonicprotected int cancelButtonMnemonic Cancel button mnemonic
 - 
updateButtonMnemonicprotected int updateButtonMnemonic Update button mnemonic
 - 
helpButtonMnemonicprotected int helpButtonMnemonic Help button mnemonic
 - 
directoryOpenButtonMnemonicprotected int directoryOpenButtonMnemonic The mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.- Since:
- 1.4
 
 - 
saveButtonTextprotected String saveButtonText Save button text
 - 
openButtonTextprotected String openButtonText Open button text
 - 
cancelButtonTextprotected String cancelButtonText Cancel button text
 - 
updateButtonTextprotected String updateButtonText Update button text
 - 
helpButtonTextprotected String helpButtonText Help button text
 - 
directoryOpenButtonTextprotected String directoryOpenButtonText The label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.- Since:
- 1.4
 
 - 
saveButtonToolTipTextprotected String saveButtonToolTipText Save button tool tip text
 - 
openButtonToolTipTextprotected String openButtonToolTipText Open button tool tip text
 - 
cancelButtonToolTipTextprotected String cancelButtonToolTipText Cancel button tool tip text
 - 
updateButtonToolTipTextprotected String updateButtonToolTipText Update button tool tip text
 - 
helpButtonToolTipTextprotected String helpButtonToolTipText Help button tool tip text
 - 
directoryOpenButtonToolTipTextprotected String directoryOpenButtonToolTipText The tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.- Since:
- 1.4
 
 
- 
 - 
Constructor Detail- 
BasicFileChooserUIpublic BasicFileChooserUI(JFileChooser b) Constructs aBasicFileChooserUI.- Parameters:
- b- file chooser
 
 
- 
 - 
Method Detail- 
createUIpublic static ComponentUI createUI(JComponent c) Creates aBasicFileChooserUIimplementation for the specified component. By default theBasicLookAndFeelclass usescreateUImethods of all basic UIs classes to instantiate UIs.- Parameters:
- c- the- JFileChooserwhich needs a UI
- Returns:
- the BasicFileChooserUIobject
- Since:
- 1.7
- See Also:
- UIDefaults.getUI(JComponent)
 
 - 
installUIpublic void installUI(JComponent c) Installs the UI.- Overrides:
- installUIin class- ComponentUI
- Parameters:
- c- the component
- See Also:
- ComponentUI.uninstallUI(javax.swing.JComponent),- JComponent.setUI(javax.swing.plaf.ComponentUI),- JComponent.updateUI()
 
 - 
uninstallUIpublic void uninstallUI(JComponent c) Uninstalls the UI.- Overrides:
- uninstallUIin class- ComponentUI
- Parameters:
- c- the component
- See Also:
- ComponentUI.installUI(javax.swing.JComponent),- JComponent.updateUI()
 
 - 
installComponentspublic void installComponents(JFileChooser fc) Installs the components.- Parameters:
- fc- the file chooser
 
 - 
uninstallComponentspublic void uninstallComponents(JFileChooser fc) Uninstalls the components.- Parameters:
- fc- the file chooser
 
 - 
installListenersprotected void installListeners(JFileChooser fc) Installs the listeners.- Parameters:
- fc- the file chooser
 
 - 
uninstallListenersprotected void uninstallListeners(JFileChooser fc) Uninstalls the listeners.- Parameters:
- fc- the file chooser
 
 - 
installDefaultsprotected void installDefaults(JFileChooser fc) Installs the defaults.- Parameters:
- fc- the file chooser
 
 - 
installIconsprotected void installIcons(JFileChooser fc) Installs the icons.- Parameters:
- fc- the file chooser
 
 - 
installStringsprotected void installStrings(JFileChooser fc) Installs the strings.- Parameters:
- fc- the file chooser
 
 - 
uninstallDefaultsprotected void uninstallDefaults(JFileChooser fc) Uninstalls the defaults.- Parameters:
- fc- the file chooser
 
 - 
uninstallIconsprotected void uninstallIcons(JFileChooser fc) Uninstalls the icons.- Parameters:
- fc- the file chooser
 
 - 
uninstallStringsprotected void uninstallStrings(JFileChooser fc) Uninstalls the strings.- Parameters:
- fc- the file chooser
 
 - 
createModelprotected void createModel() Creates the model.
 - 
getModelpublic BasicDirectoryModel getModel() Returns the model.- Returns:
- the model
 
 - 
createPropertyChangeListenerpublic PropertyChangeListener createPropertyChangeListener(JFileChooser fc) Creates the property change listener.- Parameters:
- fc- the file chooser
- Returns:
- the property change listener
 
 - 
getFileNamepublic String getFileName() Returns the file name.- Returns:
- the file name
 
 - 
getDirectoryNamepublic String getDirectoryName() Returns the directory name.- Returns:
- the directory name
 
 - 
setFileNamepublic void setFileName(String filename) Sets the file name.- Parameters:
- filename- the file name
 
 - 
setDirectoryNamepublic void setDirectoryName(String dirname) Sets the directory name.- Parameters:
- dirname- the file name
 
 - 
getFileChooserpublic JFileChooser getFileChooser() Returns the file chooser.- Returns:
- the file chooser
 
 - 
getAccessoryPanelpublic JPanel getAccessoryPanel() Returns the accessory panel.- Returns:
- the accessory panel
 
 - 
getApproveButtonprotected JButton getApproveButton(JFileChooser fc) Returns the approve button.- Parameters:
- fc- the file chooser
- Returns:
- the approve button
 
 - 
getApproveButtonToolTipTextpublic String getApproveButtonToolTipText(JFileChooser fc) Returns the approve button tool tip.- Parameters:
- fc- the file chooser
- Returns:
- the approve button tool tip
 
 - 
clearIconCachepublic void clearIconCache() Clears the icon cache.
 - 
createDoubleClickListenerprotected MouseListener createDoubleClickListener(JFileChooser fc, JList<?> list) Creates a double click listener.- Parameters:
- fc- the file chooser
- list- the list
- Returns:
- a double click listener
 
 - 
createListSelectionListenerpublic ListSelectionListener createListSelectionListener(JFileChooser fc) Creates a list selection listener.- Parameters:
- fc- the file chooser
- Returns:
- a list selection listener
 
 - 
isDirectorySelectedprotected boolean isDirectorySelected() Property to remember whether a directory is currently selected in the UI.- Returns:
- trueiff a directory is currently selected.
- Since:
- 1.4
 
 - 
setDirectorySelectedprotected void setDirectorySelected(boolean b) Property to remember whether a directory is currently selected in the UI. This is normally called by the UI on a selection event.- Parameters:
- b- iff a directory is currently selected.
- Since:
- 1.4
 
 - 
getDirectoryprotected File getDirectory() Property to remember the directory that is currently selected in the UI.- Returns:
- the value of the directoryproperty
- Since:
- 1.4
- See Also:
- setDirectory(java.io.File)
 
 - 
setDirectoryprotected void setDirectory(File f) Property to remember the directory that is currently selected in the UI. This is normally called by the UI on a selection event.- Parameters:
- f- the- Fileobject representing the directory that is currently selected
- Since:
- 1.4
 
 - 
getAcceptAllFileFilterpublic FileFilter getAcceptAllFileFilter(JFileChooser fc) Returns the default accept all file filter- Specified by:
- getAcceptAllFileFilterin class- FileChooserUI
- Parameters:
- fc- the file chooser
- Returns:
- an accept-all file filter
 
 - 
getDialogTitlepublic String getDialogTitle(JFileChooser fc) Returns the title of this dialog- Specified by:
- getDialogTitlein class- FileChooserUI
- Parameters:
- fc- the file chooser
- Returns:
- the title of this dialog
 
 - 
getApproveButtonMnemonicpublic int getApproveButtonMnemonic(JFileChooser fc) Returns the approve button mnemonic.- Parameters:
- fc- the file chooser
- Returns:
- the approve button mnemonic
 
 - 
getNewFolderActionpublic Action getNewFolderAction() Returns a new folder action.- Returns:
- a new folder action
 
 - 
getGoHomeActionpublic Action getGoHomeAction() Returns a go home action.- Returns:
- a go home action
 
 - 
getChangeToParentDirectoryActionpublic Action getChangeToParentDirectoryAction() Returns a change to parent directory action.- Returns:
- a change to parent directory action
 
 - 
getApproveSelectionActionpublic Action getApproveSelectionAction() Returns an approve selection action.- Returns:
- an approve selection action
 
 - 
getCancelSelectionActionpublic Action getCancelSelectionAction() Returns a cancel selection action.- Returns:
- a cancel selection action
 
 - 
getUpdateActionpublic Action getUpdateAction() Returns an update action.- Returns:
- an update action
 
 
- 
 
-