javax.swing.plaf.metal

Class MetalFileChooserUI


public class MetalFileChooserUI
extends BasicFileChooserUI

A UI delegate for the JFileChooser component. This class is only partially implemented and is not usable yet.

Nested Class Summary

protected class
MetalFileChooserUI.DirectoryComboBoxAction
Handles changes to the selection in the directory combo box.
protected class
MetalFileChooserUI.DirectoryComboBoxModel
A combo box model containing the selected directory and all its parent directories.
protected class
MetalFileChooserUI.FileRenderer
A renderer for the files and directories in the file chooser.
protected class
MetalFileChooserUI.FilterComboBoxModel
A combo box model for the file selection filters.
class
MetalFileChooserUI.FilterComboBoxRenderer
A renderer for the items in the file filter combo box.
protected class
MetalFileChooserUI.SingleClickListener
A mouse listener for the JFileChooser.

Nested classes/interfaces inherited from 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 inherited from 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, upFolderIcon, updateButtonMnemonic, updateButtonText, updateButtonToolTipText

Constructor Summary

MetalFileChooserUI(JFileChooser filechooser)
Creates a new instance of this UI delegate.

Method Summary

protected void
addControlButtons()
Adds the control buttons ('up', 'home' etc.) to the panel.
protected ActionMap
createActionMap()
Creates and returns an action map.
protected JPanel
createDetailsView(JFileChooser fc)
Creates a panel containing a table within a scroll pane.
protected MetalFileChooserUI.DirectoryComboBoxModel
createDirectoryComboBoxModel(JFileChooser fc)
Creates and returns a new instance of MetalFileChooserUI.DirectoryComboBoxModel.
protected javax.swing.plaf.metal.MetalFileChooserUI.DirectoryComboBoxRenderer
createDirectoryComboBoxRenderer(JFileChooser fc)
Creates a new instance of the renderer used in the directory combo box.
protected MetalFileChooserUI.FilterComboBoxModel
createFilterComboBoxModel()
Creates and returns a new instance of MetalFileChooserUI.FilterComboBoxModel.
protected MetalFileChooserUI.FilterComboBoxRenderer
createFilterComboBoxRenderer()
Creates and returns a new instance of MetalFileChooserUI.FilterComboBoxRenderer.
protected JPanel
createList(JFileChooser fc)
Creates a panel containing a list of files.
ListSelectionListener
createListSelectionListener(JFileChooser fc)
Creates a listener that monitors selections in the directory/file list and keeps the JFileChooser component up to date.
PropertyChangeListener
createPropertyChangeListener(JFileChooser fc)
Creates a property change listener that monitors the JFileChooser for property change events and updates the component display accordingly.
static ComponentUI
createUI(JComponent c)
A factory method that returns a UI delegate for the specified component.
protected ActionMap
getActionMap()
protected JButton
getApproveButton(JFileChooser fc)
Returns the approve button.
protected JPanel
getBottomPanel()
Creates and returns a new panel that will be used for the controls at the bottom of the file chooser.
protected JPanel
getButtonPanel()
Returns the panel that contains the 'Open' (or 'Save') and 'Cancel' buttons.
String
getFileName()
Returns the file name in the text field.
Dimension
getMaximumSize(JComponent c)
Returns the maximum size for the file chooser component.
Dimension
getMinimumSize(JComponent c)
Returns the minimum size for the file chooser component.
Dimension
getPreferredSize(JComponent c)
Returns the preferred size for the file chooser component.
void
installComponents(JFileChooser fc)
Installs the sub-components of the file chooser.
protected void
installListeners(JFileChooser fc)
Installs the listeners required.
protected void
installStrings(JFileChooser fc)
Fetches localised strings for use by the labels and buttons on the file chooser.
void
installUI(JComponent c)
Installs the UI for the specified component.
protected void
removeControlButtons()
Removes all the buttons from the control panel.
void
rescanCurrentDirectory(JFileChooser fc)
Updates the current directory.
void
setFileName(String filename)
Sets the file name in the text field.
void
uninstallComponents(JFileChooser fc)
Uninstalls the components added by installComponents(JFileChooser).
protected void
uninstallListeners(JFileChooser fc)
Uninstalls the listeners previously installed by this UI delegate.
void
uninstallUI(JComponent c)
Uninstalls this UI from the given component.
void
valueChanged(ListSelectionEvent e)
DOCUMENT ME!

Methods inherited from class javax.swing.plaf.basic.BasicFileChooserUI

clearIconCache, createDoubleClickListener, createListSelectionListener, createModel, createPropertyChangeListener, createUI, ensureFileIsVisible, getAcceptAllFileFilter, getAccessoryPanel, getApproveButton, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getApproveSelectionAction, getCancelSelectionAction, getChangeToParentDirectoryAction, getDialogTitle, getDirectory, getDirectoryName, getFileChooser, getFileName, getFileView, getGoHomeAction, getModel, getNewFolderAction, getUpdateAction, installComponents, installDefaults, installIcons, installListeners, installStrings, installUI, isDirectorySelected, rescanCurrentDirectory, setDirectory, setDirectoryName, setDirectorySelected, setFileName, uninstallComponents, uninstallDefaults, uninstallIcons, uninstallListeners, uninstallStrings, uninstallUI

Methods inherited from class javax.swing.plaf.FileChooserUI

ensureFileIsVisible, getAcceptAllFileFilter, getApproveButtonText, getDialogTitle, getFileView, rescanCurrentDirectory

Methods inherited from class javax.swing.plaf.ComponentUI

contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MetalFileChooserUI

public MetalFileChooserUI(JFileChooser filechooser)
Creates a new instance of this UI delegate.
Parameters:
filechooser - the file chooser component.

Method Details

addControlButtons

protected void addControlButtons()
Adds the control buttons ('up', 'home' etc.) to the panel.

createActionMap

protected ActionMap createActionMap()
Creates and returns an action map.
Returns:
The action map.

createDetailsView

protected JPanel createDetailsView(JFileChooser fc)
Creates a panel containing a table within a scroll pane.
Parameters:
fc - the file chooser.
Returns:
The details view.

createDirectoryComboBoxModel

protected MetalFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc)
Creates and returns a new instance of MetalFileChooserUI.DirectoryComboBoxModel.

createDirectoryComboBoxRenderer

protected javax.swing.plaf.metal.MetalFileChooserUI.DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc)
Creates a new instance of the renderer used in the directory combo box.
Parameters:
fc - the file chooser.
Returns:
The renderer.

createFilterComboBoxModel

protected MetalFileChooserUI.FilterComboBoxModel createFilterComboBoxModel()
Creates and returns a new instance of MetalFileChooserUI.FilterComboBoxModel.
Returns:
A new instance of MetalFileChooserUI.FilterComboBoxModel.

createFilterComboBoxRenderer

protected MetalFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer()
Creates and returns a new instance of MetalFileChooserUI.FilterComboBoxRenderer.

createList

protected JPanel createList(JFileChooser fc)
Creates a panel containing a list of files.
Parameters:
fc - the file chooser.
Returns:
A panel.

createListSelectionListener

public ListSelectionListener createListSelectionListener(JFileChooser fc)
Creates a listener that monitors selections in the directory/file list and keeps the JFileChooser component up to date.
Overrides:
createListSelectionListener in interface BasicFileChooserUI
Parameters:
fc - the file chooser.
Returns:
The listener.

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
Creates a property change listener that monitors the JFileChooser for property change events and updates the component display accordingly.
Overrides:
createPropertyChangeListener in interface BasicFileChooserUI
Parameters:
fc - the file chooser.
Returns:
The property change listener.

createUI

public static ComponentUI createUI(JComponent c)
A factory method that returns a UI delegate for the specified component.
Overrides:
createUI in interface BasicFileChooserUI
Parameters:
c - the component (which should be a JFileChooser).

getActionMap

protected ActionMap getActionMap()

getApproveButton

protected JButton getApproveButton(JFileChooser fc)
Returns the approve button.
Overrides:
getApproveButton in interface BasicFileChooserUI
Returns:
The approve button.

getBottomPanel

protected JPanel getBottomPanel()
Creates and returns a new panel that will be used for the controls at the bottom of the file chooser.
Returns:
A new panel.

getButtonPanel

protected JPanel getButtonPanel()
Returns the panel that contains the 'Open' (or 'Save') and 'Cancel' buttons.
Returns:
The panel.

getFileName

public String getFileName()
Returns the file name in the text field.
Overrides:
getFileName in interface BasicFileChooserUI
Returns:
The file name.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Returns the maximum size for the file chooser component.
Overrides:
getMaximumSize in interface ComponentUI
Returns:
The maximum size.

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Returns the minimum size for the file chooser component.
Overrides:
getMinimumSize in interface ComponentUI
Returns:
The minimum size.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Returns the preferred size for the file chooser component.
Overrides:
getPreferredSize in interface ComponentUI
Returns:
The preferred size.

installComponents

public void installComponents(JFileChooser fc)
Installs the sub-components of the file chooser.
Overrides:
installComponents in interface BasicFileChooserUI
Parameters:
fc - the file chooser component.

installListeners

protected void installListeners(JFileChooser fc)
Installs the listeners required.
Overrides:
installListeners in interface BasicFileChooserUI
Parameters:
fc - the file chooser.

installStrings

protected void installStrings(JFileChooser fc)
Fetches localised strings for use by the labels and buttons on the file chooser.
Overrides:
installStrings in interface BasicFileChooserUI
Parameters:
fc - the file chooser.

installUI

public void installUI(JComponent c)
Installs the UI for the specified component.
Overrides:
installUI in interface BasicFileChooserUI
Parameters:
c - the component (should be a JFileChooser).

removeControlButtons

protected void removeControlButtons()
Removes all the buttons from the control panel.

rescanCurrentDirectory

public void rescanCurrentDirectory(JFileChooser fc)
Updates the current directory.
Overrides:
rescanCurrentDirectory in interface BasicFileChooserUI
Parameters:
fc - the file chooser to update.

setFileName

public void setFileName(String filename)
Sets the file name in the text field.
Overrides:
setFileName in interface BasicFileChooserUI
Parameters:
filename - the file name.

uninstallComponents

public void uninstallComponents(JFileChooser fc)
Uninstalls the components added by installComponents(JFileChooser).
Overrides:
uninstallComponents in interface BasicFileChooserUI
Parameters:
fc - the file chooser.

uninstallListeners

protected void uninstallListeners(JFileChooser fc)
Uninstalls the listeners previously installed by this UI delegate.
Overrides:
uninstallListeners in interface BasicFileChooserUI
Parameters:
fc - the file chooser.

uninstallUI

public void uninstallUI(JComponent c)
Uninstalls this UI from the given component.
Overrides:
uninstallUI in interface BasicFileChooserUI
Parameters:
c - the component (should be a JFileChooser).

valueChanged

public void valueChanged(ListSelectionEvent e)
DOCUMENT ME!!
Parameters:
e - - DOCUMENT ME!

MetalFileChooserUI.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.