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 declared in class BasicFileChooserUI
BasicFileChooserUI.AcceptAllFileFilter, BasicFileChooserUI.ApproveSelectionAction, BasicFileChooserUI.BasicFileView, BasicFileChooserUI.CancelSelectionAction, BasicFileChooserUI.ChangeToParentDirectoryAction, BasicFileChooserUI.DoubleClickListener, BasicFileChooserUI.GoHomeAction, BasicFileChooserUI.NewFolderAction, BasicFileChooserUI.SelectionListener, BasicFileChooserUI.UpdateActionModifier and TypeClassDescriptionprotected classAccept all file filter.protected classResponds to an Open or Save requestprotected classA basic file view.protected classResponds to a cancel request.protected classChange to parent directory action.protected classA double click listener.protected classActs on the "home" key event or equivalent event.protected classCreates a new folder.protected classA selection listener.protected classRescans 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, viewMenuIconModifier and TypeFieldDescriptionprotected intCancel button mnemonicprotected StringCancel button textprotected StringCancel button tool tip textprotected IconComputer iconprotected IconDetails view iconprotected IconDirectory iconprotected intThe mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected StringThe label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected StringThe tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected IconFile iconprotected IconFloppy drive iconprotected IconHard drive iconprotected intHelp button mnemonicprotected StringHelp button textprotected StringHelp button tool tip textprotected IconHome folder iconprotected IconList view iconprotected IconNew folder iconprotected intOpen button mnemonicprotected StringOpen button textprotected StringOpen button tool tip textprotected intSave button mnemonicprotected StringSave button textprotected StringSave button tool tip textprotected intUpdate button mnemonicprotected StringUpdate button textprotected StringUpdate button tool tip textprotected IconUp folder iconprotected IconView menu icon -
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.static ComponentUIConstructs a new instance ofMetalFileChooserUI.protected ActionMapReturns an instance ofActionMap.protected JPanelReturns the bottom panel.protected JPanelReturns 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 voidRemoves control buttons from bottom panel.voidsetDirectoryName(String dirname) Sets the directory name.protected voidsetDirectorySelected(boolean directorySelected) Property to remember whether a directory is currently selected in the UI.voidInvokes whenListSelectionEventoccurs.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, uninstallUIModifier and TypeMethodDescriptionvoidClears the icon cache.protected MouseListenercreateDoubleClickListener(JFileChooser fc, JList<?> list) Creates a double click listener.protected voidCreates the model.Creates the property change listener.voidensureFileIsVisible(JFileChooser fc, File f) Ensure the file in question is visible.Returns the default accept all file filterReturns the accessory panel.protected JButtonReturns the approve button.intReturns 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 FileProperty 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.voidInstalls the components.protected voidInstalls the defaults.protected voidInstalls the icons.protected voidInstalls the listeners.protected voidInstalls the strings.voidInstalls the UI.protected booleanProperty to remember whether a directory is currently selected in the UI.voidRescan the current directory.protected voidsetDirectory(File f) Property to remember the directory that is currently selected in the UI.voidsetFileName(String filename) Sets the file name.voidUninstalls the components.protected voidUninstalls the defaults.protected voidUninstalls the icons.protected voidUninstalls the listeners.protected voidUninstalls the strings.voidUninstalls the UI.Methods declared in class FileChooserUI
getDefaultButtonModifier and TypeMethodDescriptionReturns default button for currentLookAndFeel.Methods declared in class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, updateModifier and TypeMethodDescriptionbooleancontains(JComponent c, int x, int y) Returnstrueif 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 theithAccessiblechild of the object.intReturns the number of accessible children in the object.intgetBaseline(JComponent c, int width, int height) Returns the baseline.Returns an enum indicating how the baseline of the component changes as the size changes.voidpaint(Graphics g, JComponent c) Paints the specified component appropriately for the look and feel.voidupdate(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, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.booleanIndicates whether some other object is "equal to" this one.protected voidfinalize()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.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(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 voidwait(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:
createListSelectionListenerin 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:
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:
-
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:
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
-