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 class
Acts when DirectoryComboBox has changed the selected item.protected class
Data model for a type-face selection combo-box.protected class
Deprecated.As of JDK version 9.protected class
Data model for a type-face selection combo-box.class
Render different type sizes and styles.protected class
Deprecated.As of JDK version 9.Nested classes/interfaces declared in class BasicFileChooserUI
BasicFileChooserUI.AcceptAllFileFilter, BasicFileChooserUI.ApproveSelectionAction, BasicFileChooserUI.BasicFileView, BasicFileChooserUI.CancelSelectionAction, BasicFileChooserUI.ChangeToParentDirectoryAction, BasicFileChooserUI.DoubleClickListener, BasicFileChooserUI.GoHomeAction, BasicFileChooserUI.NewFolderAction, BasicFileChooserUI.SelectionListener, BasicFileChooserUI.UpdateAction
Modifier and TypeClassDescriptionprotected class
Accept all file filter.protected class
Responds to an Open or Save requestprotected class
A basic file view.protected class
Responds to a cancel request.protected class
Change to parent directory action.protected class
A double click listener.protected class
Acts on the "home" key event or equivalent event.protected class
Creates a new folder.protected class
A selection listener.protected class
Rescans the files in the current directory -
Field Summary
Fields declared in 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
Modifier and TypeFieldDescriptionprotected int
Cancel button mnemonicprotected String
Cancel button textprotected String
Cancel button tool tip textprotected Icon
Computer iconprotected Icon
Details view iconprotected Icon
Directory iconprotected int
The mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected String
The label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected String
The tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected Icon
File iconprotected Icon
Floppy drive iconprotected Icon
Hard drive iconprotected int
Help button mnemonicprotected String
Help button textprotected String
Help button tool tip textprotected Icon
Home folder iconprotected Icon
List view iconprotected Icon
New folder iconprotected int
Open button mnemonicprotected String
Open button textprotected String
Open button tool tip textprotected int
Save button mnemonicprotected String
Save button textprotected String
Save button tool tip textprotected int
Update button mnemonicprotected String
Update button textprotected String
Update button tool tip textprotected Icon
Up folder iconprotected Icon
View menu icon -
Constructor Summary
ConstructorsConstructorDescriptionMetalFileChooserUI
(JFileChooser filechooser) Constructs a new instance ofMetalFileChooserUI
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds control buttons to bottom panel.protected ActionMap
Constructs an instance ofActionMap
.protected JPanel
Constructs a details view.Constructs a new instance ofDataModel
forDirectoryComboBox
.protected MetalFileChooserUI.FilterComboBoxModel
Constructs aDataModel
for typesComboBox
.Constructs aRenderer
for typesComboBox
.protected JPanel
Constructs a details view.Creates a selection listener for the list of files and directories.static ComponentUI
Constructs a new instance ofMetalFileChooserUI
.protected ActionMap
Returns an instance ofActionMap
.protected JPanel
Returns the bottom panel.protected JPanel
Returns the button panel.Returns the directory name.Returns the maximum size of theJFileChooser
.Returns the minimum size of theJFileChooser
.Returns the preferred size of the specifiedJFileChooser
.protected void
Removes control buttons from bottom panel.void
setDirectoryName
(String dirname) Sets the directory name.protected void
setDirectorySelected
(boolean directorySelected) Property to remember whether a directory is currently selected in the UI.void
Invokes whenListSelectionEvent
occurs.Methods declared in class 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
Modifier and TypeMethodDescriptionvoid
Clears the icon cache.protected MouseListener
createDoubleClickListener
(JFileChooser fc, JList<?> list) Creates a double click listener.protected void
Creates the model.Creates the property change listener.void
ensureFileIsVisible
(JFileChooser fc, File f) Ensure the file in question is visible.Returns the default accept all file filterReturns the accessory panel.protected JButton
Returns the approve button.int
Returns the approve button mnemonic.Returns approve button text.Returns the approve button tool tip.Returns an approve selection action.Returns a cancel selection action.Returns a change to parent directory action.Returns the title of this dialogprotected File
Property to remember the directory that is currently selected in the UI.Returns the file chooser.Returns the file name.Returns a file view.Returns a go home action.getModel()
Returns the model.Returns a new folder action.Returns an update action.void
Installs the components.protected void
Installs the defaults.protected void
Installs the icons.protected void
Installs the listeners.protected void
Installs the strings.void
Installs the UI.protected boolean
Property to remember whether a directory is currently selected in the UI.void
Rescan the current directory.protected void
setDirectory
(File f) Property to remember the directory that is currently selected in the UI.void
setFileName
(String filename) Sets the file name.void
Uninstalls the components.protected void
Uninstalls the defaults.protected void
Uninstalls the icons.protected void
Uninstalls the listeners.protected void
Uninstalls the strings.void
Uninstalls the UI.Methods declared in class FileChooserUI
getDefaultButton
Modifier and TypeMethodDescriptionReturns default button for currentLookAndFeel
.Methods declared in class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
Modifier and TypeMethodDescriptionboolean
contains
(JComponent c, int x, int y) Returnstrue
if the specified x,y location is contained within the look and feel's defined shape of the specified component.getAccessibleChild
(JComponent c, int i) Returns thei
thAccessible
child of the object.int
Returns the number of accessible children in the object.int
getBaseline
(JComponent c, int width, int height) Returns the baseline.Returns an enum indicating how the baseline of the component changes as the size changes.void
paint
(Graphics g, JComponent c) Paints the specified component appropriately for the look and feel.void
update
(Graphics g, JComponent c) Notifies this UI delegate that it is time to paint the specified component.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
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
-
getButtonPanel
-
getBottomPanel
-
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:
createListSelectionListener
in classBasicFileChooserUI
- Parameters:
fc
- aJFileChooser
- Returns:
- a
ListSelectionListener
-
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:
getPreferredSize
in classComponentUI
- Parameters:
c
- aJFileChooser
- Returns:
- a
Dimension
specifying the preferred width and height of the file chooser - See Also:
-
getMinimumSize
Returns the minimum size of theJFileChooser
.- Overrides:
getMinimumSize
in classComponentUI
- Parameters:
c
- aJFileChooser
- Returns:
- a
Dimension
specifying the minimum width and height of the file chooser - See Also:
-
getMaximumSize
Returns the maximum size of theJFileChooser
.- 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
Returns the directory name.- Overrides:
getDirectoryName
in classBasicFileChooserUI
- Returns:
- the directory name
-
setDirectoryName
Sets the directory name.- Overrides:
setDirectoryName
in classBasicFileChooserUI
- Parameters:
dirname
- the directory name
-
createDirectoryComboBoxModel
Constructs a new instance ofDataModel
forDirectoryComboBox
.- Parameters:
fc
- aJFileChooser
- Returns:
- a new instance of
DataModel
forDirectoryComboBox
-
createFilterComboBoxRenderer
Constructs aRenderer
for typesComboBox
.- Returns:
- a
Renderer
for typesComboBox
-
createFilterComboBoxModel
Constructs aDataModel
for typesComboBox
.- Returns:
- a
DataModel
for typesComboBox
-
valueChanged
Invokes whenListSelectionEvent
occurs.- Parameters:
e
- an instance ofListSelectionEvent
-