Class MetalFileChooserUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.FileChooserUI
javax.swing.plaf.basic.BasicFileChooserUI
javax.swing.plaf.metal.MetalFileChooserUI
public class MetalFileChooserUI extends BasicFileChooserUI
Metal L&F implementation of a FileChooser.
Nested Class Summary
Modifier and Type | Class | Description |
---|---|---|
protected class |
MetalFileChooserUI.DirectoryComboBoxAction |
Acts when DirectoryComboBox has changed the selected item. |
protected class |
MetalFileChooserUI.DirectoryComboBoxModel |
Data model for a type-face selection combo-box. |
protected class |
MetalFileChooserUI.FileRenderer |
Deprecated. As of JDK version 9. |
protected class |
MetalFileChooserUI.FilterComboBoxModel |
Data model for a type-face selection combo-box. |
class |
MetalFileChooserUI.FilterComboBoxRenderer |
Render different type sizes and styles. |
protected class |
MetalFileChooserUI.SingleClickListener |
Deprecated. As of JDK version 9. |
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicFileChooserUI
BasicFileChooserUI.AcceptAllFileFilter, BasicFileChooserUI.ApproveSelectionAction, BasicFileChooserUI.BasicFileView, BasicFileChooserUI.CancelSelectionAction, BasicFileChooserUI.ChangeToParentDirectoryAction, BasicFileChooserUI.DoubleClickListener, BasicFileChooserUI.GoHomeAction, BasicFileChooserUI.NewFolderAction, BasicFileChooserUI.SelectionListener, BasicFileChooserUI.UpdateAction
Field Summary
Fields declared in class javax.swing.plaf.basic.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
Constructor | Description |
---|---|
MetalFileChooserUI |
Constructs a new instance of MetalFileChooserUI . |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
protected void |
addControlButtons() |
Adds control buttons to bottom panel. |
protected ActionMap |
createActionMap() |
Constructs an instance of ActionMap . |
protected JPanel |
createDetailsView |
Constructs a details view. |
protected MetalFileChooserUI.DirectoryComboBoxModel |
createDirectoryComboBoxModel |
Constructs a new instance of DataModel for DirectoryComboBox . |
protected MetalFileChooserUI.FilterComboBoxModel |
createFilterComboBoxModel() |
Constructs a DataModel for types ComboBox . |
protected MetalFileChooserUI.FilterComboBoxRenderer |
createFilterComboBoxRenderer() |
Constructs a Renderer for types ComboBox . |
protected JPanel |
createList |
Constructs a details view. |
ListSelectionListener |
createListSelectionListener |
Creates a selection listener for the list of files and directories. |
static ComponentUI |
createUI |
Constructs a new instance of MetalFileChooserUI . |
protected ActionMap |
getActionMap() |
Returns an instance of ActionMap . |
protected JPanel |
getBottomPanel() |
Returns the bottom panel. |
protected JPanel |
getButtonPanel() |
Returns the button panel. |
String |
getDirectoryName() |
Returns the directory name. |
Dimension |
getMaximumSize |
Returns the maximum size of the JFileChooser . |
Dimension |
getMinimumSize |
Returns the minimum size of the JFileChooser . |
Dimension |
getPreferredSize |
Returns the preferred size of the specified JFileChooser . |
protected void |
removeControlButtons() |
Removes control buttons from bottom panel. |
void |
setDirectoryName |
Sets the directory name. |
protected void |
setDirectorySelected |
Property to remember whether a directory is currently selected in the UI. |
void |
valueChanged |
Invokes when ListSelectionEvent occurs. |
Methods declared in class javax.swing.plaf.basic.BasicFileChooserUI
clearIconCache, createDoubleClickListener, createModel, createPropertyChangeListener, ensureFileIsVisible, getAcceptAllFileFilter, getAccessoryPanel, getApproveButton, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getApproveSelectionAction, getCancelSelectionAction, getChangeToParentDirectoryAction, getDialogTitle, getDirectory, getFileChooser, getFileName, getFileView, getGoHomeAction, getModel, getNewFolderAction, getUpdateAction, installComponents, installDefaults, installIcons, installListeners, installStrings, installUI, isDirectorySelected, rescanCurrentDirectory, setDirectory, setFileName, uninstallComponents, uninstallDefaults, uninstallIcons, uninstallListeners, uninstallStrings, uninstallUI
Methods declared in class javax.swing.plaf.FileChooserUI
getDefaultButton
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
Constructor Details
MetalFileChooserUI
public MetalFileChooserUI(JFileChooser filechooser)
Constructs a new instance of
MetalFileChooserUI
.- Parameters:
-
filechooser
- aJFileChooser
Method Details
createUI
public static ComponentUI createUI(JComponent c)
Constructs a new instance of
MetalFileChooserUI
.- Parameters:
-
c
- a component - Returns:
- a new instance of
MetalFileChooserUI
getButtonPanel
protected JPanel getButtonPanel()
Returns the button panel.
- Returns:
- the button panel
getBottomPanel
protected JPanel getBottomPanel()
Returns the bottom panel.
- Returns:
- the bottom panel
getActionMap
protected ActionMap getActionMap()
Returns an instance of
ActionMap
.- Returns:
- an instance of
ActionMap
createActionMap
protected ActionMap createActionMap()
Constructs an instance of
ActionMap
.- Returns:
- an instance of
ActionMap
createList
protected JPanel createList(JFileChooser fc)
Constructs a details view.
- Parameters:
-
fc
- aJFileChooser
- Returns:
- the list
createDetailsView
protected JPanel createDetailsView(JFileChooser fc)
Constructs a details view.
- Parameters:
-
fc
- aJFileChooser
- Returns:
- the details view
createListSelectionListener
public ListSelectionListener createListSelectionListener(JFileChooser fc)
Creates a selection listener for the list of files and directories.
- Overrides:
-
createListSelectionListener
in classBasicFileChooserUI
- Parameters:
-
fc
- aJFileChooser
- Returns:
- a
ListSelectionListener
getPreferredSize
public Dimension getPreferredSize(JComponent c)
Returns the preferred size of the specified
JFileChooser
. 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:
-
getPreferredSize
in classComponentUI
- Parameters:
-
c
- aJFileChooser
- Returns:
- a
Dimension
specifying the preferred width and height of the file chooser - See Also:
getMinimumSize
public Dimension getMinimumSize(JComponent c)
Returns the minimum size of the
JFileChooser
.- Overrides:
-
getMinimumSize
in classComponentUI
- Parameters:
-
c
- aJFileChooser
- Returns:
- a
Dimension
specifying the minimum width and height of the file chooser - See Also:
getMaximumSize
public Dimension getMaximumSize(JComponent c)
Returns the maximum size of the
JFileChooser
.- Overrides:
-
getMaximumSize
in classComponentUI
- Parameters:
-
c
- aJFileChooser
- Returns:
- a
Dimension
specifying the maximum width and height of the file chooser - See Also:
removeControlButtons
protected void removeControlButtons()
Removes control buttons from bottom panel.
addControlButtons
protected void addControlButtons()
Adds control buttons to bottom panel.
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:
-
setDirectorySelected
in classBasicFileChooserUI
- Parameters:
-
directorySelected
- if a directory is currently selected. - Since:
- 1.4
getDirectoryName
public String getDirectoryName()
Returns the directory name.
- Overrides:
-
getDirectoryName
in classBasicFileChooserUI
- Returns:
- the directory name
setDirectoryName
public void setDirectoryName(String dirname)
Sets the directory name.
- Overrides:
-
setDirectoryName
in classBasicFileChooserUI
- Parameters:
-
dirname
- the directory name
createDirectoryComboBoxModel
protected MetalFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc)
Constructs a new instance of
DataModel
for DirectoryComboBox
.- Parameters:
-
fc
- aJFileChooser
- Returns:
- a new instance of
DataModel
forDirectoryComboBox
createFilterComboBoxRenderer
protected MetalFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer()
Constructs a
Renderer
for types ComboBox
.- Returns:
- a
Renderer
for typesComboBox
createFilterComboBoxModel
protected MetalFileChooserUI.FilterComboBoxModel createFilterComboBoxModel()
Constructs a
DataModel
for types ComboBox
.- Returns:
- a
DataModel
for typesComboBox
valueChanged
public void valueChanged(ListSelectionEvent e)
Invokes when
ListSelectionEvent
occurs.- Parameters:
-
e
- an instance ofListSelectionEvent
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/plaf/metal/MetalFileChooserUI.html