Class MetalFileChooserUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.FileChooserUI
javax.swing.plaf.basic.BasicFileChooserUI
javax.swing.plaf.metal.MetalFileChooserUI
Metal L&F implementation of a FileChooser.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classActs when DirectoryComboBox has changed the selected item.protected classData model for a type-face selection combo-box.protected classDeprecated.As of JDK version 9.protected classData model for a type-face selection combo-box.classRender different type sizes and styles.protected classDeprecated.As of JDK version 9.Nested classes/interfaces inherited from class BasicFileChooserUI
BasicFileChooserUI.AcceptAllFileFilter, BasicFileChooserUI.ApproveSelectionAction, BasicFileChooserUI.BasicFileView, BasicFileChooserUI.CancelSelectionAction, BasicFileChooserUI.ChangeToParentDirectoryAction, BasicFileChooserUI.DoubleClickListener, BasicFileChooserUI.GoHomeAction, BasicFileChooserUI.NewFolderAction, BasicFileChooserUI.SelectionListener, BasicFileChooserUI.UpdateAction -
Field Summary
Fields inherited from class BasicFileChooserUI
cancelButtonMnemonic, cancelButtonText, cancelButtonToolTipText, computerIcon, detailsViewIcon, directoryIcon, directoryOpenButtonMnemonic, directoryOpenButtonText, directoryOpenButtonToolTipText, fileIcon, floppyDriveIcon, hardDriveIcon, helpButtonMnemonic, helpButtonText, helpButtonToolTipText, homeFolderIcon, listViewIcon, newFolderIcon, openButtonMnemonic, openButtonText, openButtonToolTipText, saveButtonMnemonic, saveButtonText, saveButtonToolTipText, updateButtonMnemonic, updateButtonText, updateButtonToolTipText, upFolderIcon, viewMenuIcon -
Constructor Summary
ConstructorsConstructorDescriptionMetalFileChooserUI(JFileChooser filechooser) Constructs a new instance ofMetalFileChooserUI. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds control buttons to bottom panel.protected ActionMapConstructs an instance ofActionMap.protected JPanelConstructs a details view.Constructs a new instance ofDataModelforDirectoryComboBox.protected MetalFileChooserUI.FilterComboBoxModelConstructs aDataModelfor typesComboBox.Constructs aRendererfor typesComboBox.protected JPanelConstructs a details view.Creates a selection listener for the list of files and directories.Creates the property change listener.static ComponentUIConstructs a new instance ofMetalFileChooserUI.voidensureFileIsVisible(JFileChooser fc, File f) Ensure the file in question is visible.protected ActionMapReturns an instance ofActionMap.protected JButtonReturns the approve button.protected JPanelReturns the bottom panel.protected JPanelReturns the button panel.Returns the directory name.Returns the file name.Returns the maximum size of theJFileChooser.Returns the minimum size of theJFileChooser.Returns the preferred size of the specifiedJFileChooser.voidInstalls the components.protected voidInstalls the listeners.protected voidInstalls the strings.voidInstalls the UI.protected voidRemoves control buttons from bottom panel.voidRescan the current directory.voidsetDirectoryName(String dirname) Sets the directory name.protected voidsetDirectorySelected(boolean directorySelected) Property to remember whether a directory is currently selected in the UI.voidsetFileName(String filename) Sets the file name.voidUninstalls the components.voidUninstalls the UI.voidInvokes whenListSelectionEventoccurs.Methods inherited from class BasicFileChooserUI
clearIconCache, createDoubleClickListener, createModel, getAcceptAllFileFilter, getAccessoryPanel, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getApproveSelectionAction, getCancelSelectionAction, getChangeToParentDirectoryAction, getDefaultButton, getDialogTitle, getDirectory, getFileChooser, getFileView, getGoHomeAction, getModel, getNewFolderAction, getUpdateAction, installDefaults, installIcons, isDirectorySelected, setDirectory, uninstallDefaults, uninstallIcons, uninstallListeners, uninstallStringsMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
-
Constructor Details
-
MetalFileChooserUI
Constructs a new instance ofMetalFileChooserUI.- Parameters:
filechooser- aJFileChooser
-
-
Method Details
-
createUI
Constructs a new instance ofMetalFileChooserUI.- Parameters:
c- a component- Returns:
- a new instance of
MetalFileChooserUI
-
installUI
Description copied from class:BasicFileChooserUIInstalls the UI.- Overrides:
installUIin classBasicFileChooserUI- Parameters:
c- the component- See Also:
-
uninstallComponents
Description copied from class:BasicFileChooserUIUninstalls the components.- Overrides:
uninstallComponentsin classBasicFileChooserUI- Parameters:
fc- the file chooser
-
installComponents
Description copied from class:BasicFileChooserUIInstalls the components.- Overrides:
installComponentsin classBasicFileChooserUI- Parameters:
fc- the file chooser
-
getButtonPanel
-
getBottomPanel
-
installStrings
Description copied from class:BasicFileChooserUIInstalls the strings.- Overrides:
installStringsin classBasicFileChooserUI- Parameters:
fc- the file chooser
-
installListeners
Description copied from class:BasicFileChooserUIInstalls the listeners.- Overrides:
installListenersin classBasicFileChooserUI- Parameters:
fc- the file chooser
-
getActionMap
Returns an instance ofActionMap.- Returns:
- an instance of
ActionMap
-
createActionMap
Constructs an instance ofActionMap.- Returns:
- an instance of
ActionMap
-
createList
Constructs a details view.- Parameters:
fc- aJFileChooser- Returns:
- the list
-
createDetailsView
Constructs a details view.- Parameters:
fc- aJFileChooser- Returns:
- the details view
-
createListSelectionListener
Creates a selection listener for the list of files and directories.- Overrides:
createListSelectionListenerin classBasicFileChooserUI- Parameters:
fc- aJFileChooser- Returns:
- a
ListSelectionListener
-
uninstallUI
Description copied from class:BasicFileChooserUIUninstalls the UI.- Overrides:
uninstallUIin classBasicFileChooserUI- Parameters:
c- the component- See Also:
-
getPreferredSize
Returns the preferred size of the specifiedJFileChooser. The preferred size is at least as large, in both height and width, as the preferred size recommended by the file chooser's layout manager.- Overrides:
getPreferredSizein classComponentUI- Parameters:
c- aJFileChooser- Returns:
- a
Dimensionspecifying the preferred width and height of the file chooser - See Also:
-
getMinimumSize
Returns the minimum size of theJFileChooser.- Overrides:
getMinimumSizein classComponentUI- Parameters:
c- aJFileChooser- Returns:
- a
Dimensionspecifying the minimum width and height of the file chooser - See Also:
-
getMaximumSize
Returns the maximum size of theJFileChooser.- Overrides:
getMaximumSizein classComponentUI- Parameters:
c- aJFileChooser- Returns:
- a
Dimensionspecifying the maximum width and height of the file chooser - See Also:
-
createPropertyChangeListener
Description copied from class:BasicFileChooserUICreates the property change listener.- Overrides:
createPropertyChangeListenerin classBasicFileChooserUI- Parameters:
fc- the file chooser- Returns:
- the property change listener
-
removeControlButtons
protected void removeControlButtons()Removes control buttons from bottom panel. -
addControlButtons
protected void addControlButtons()Adds control buttons to bottom panel. -
ensureFileIsVisible
Description copied from class:BasicFileChooserUIEnsure the file in question is visible.- Overrides:
ensureFileIsVisiblein classBasicFileChooserUI- Parameters:
fc- the file chooserf- the file
-
rescanCurrentDirectory
Description copied from class:BasicFileChooserUIRescan the current directory.- Overrides:
rescanCurrentDirectoryin classBasicFileChooserUI- Parameters:
fc- the file chooser
-
getFileName
Description copied from class:BasicFileChooserUIReturns the file name.- Overrides:
getFileNamein classBasicFileChooserUI- Returns:
- the file name
-
setFileName
Description copied from class:BasicFileChooserUISets the file name.- Overrides:
setFileNamein classBasicFileChooserUI- Parameters:
filename- the file name
-
setDirectorySelected
protected void setDirectorySelected(boolean directorySelected) Property to remember whether a directory is currently selected in the UI. This is normally called by the UI on a selection event.- Overrides:
setDirectorySelectedin classBasicFileChooserUI- Parameters:
directorySelected- if a directory is currently selected.- Since:
- 1.4
-
getDirectoryName
Returns the directory name.- Overrides:
getDirectoryNamein classBasicFileChooserUI- Returns:
- the directory name
-
setDirectoryName
Sets the directory name.- Overrides:
setDirectoryNamein classBasicFileChooserUI- Parameters:
dirname- the directory name
-
createDirectoryComboBoxModel
Constructs a new instance ofDataModelforDirectoryComboBox.- Parameters:
fc- aJFileChooser- Returns:
- a new instance of
DataModelforDirectoryComboBox
-
createFilterComboBoxRenderer
Constructs aRendererfor typesComboBox.- Returns:
- a
Rendererfor typesComboBox
-
createFilterComboBoxModel
Constructs aDataModelfor typesComboBox.- Returns:
- a
DataModelfor typesComboBox
-
valueChanged
Invokes whenListSelectionEventoccurs.- Parameters:
e- an instance ofListSelectionEvent
-
getApproveButton
Description copied from class:BasicFileChooserUIReturns the approve button.- Overrides:
getApproveButtonin classBasicFileChooserUI- Parameters:
fc- the file chooser- Returns:
- the approve button
-