javax.swing.plaf.metal

Class MetalFileChooserUI

public class MetalFileChooserUI extends BasicFileChooserUI

A UI delegate for the {@link JFileChooser} component. This class is only partially implemented and is not usable yet.
Nested Class Summary
protected classMetalFileChooserUI.DirectoryComboBoxAction
Handles changes to the selection in the directory combo box.
protected classMetalFileChooserUI.DirectoryComboBoxModel
A combo box model containing the selected directory and all its parent directories.
protected classMetalFileChooserUI.FileRenderer
A renderer for the files and directories in the file chooser.
protected classMetalFileChooserUI.FilterComboBoxModel
A combo box model for the file selection filters.
classMetalFileChooserUI.FilterComboBoxRenderer
A renderer for the items in the file filter combo box.
protected classMetalFileChooserUI.SingleClickListener
A mouse listener for the {@link JFileChooser}.
Constructor Summary
MetalFileChooserUI(JFileChooser filechooser)
Creates a new instance of this UI delegate.
Method Summary
protected voidaddControlButtons()
Adds the control buttons ('up', 'home' etc.) to the panel.
protected ActionMapcreateActionMap()
Creates and returns an action map.
protected JPanelcreateDetailsView(JFileChooser fc)
Creates a panel containing a table within a scroll pane.
protected MetalFileChooserUI.DirectoryComboBoxModelcreateDirectoryComboBoxModel(JFileChooser fc)
Creates and returns a new instance of {@link DirectoryComboBoxModel}.
protected MetalFileChooserUI.DirectoryComboBoxRenderercreateDirectoryComboBoxRenderer(JFileChooser fc)
Creates a new instance of the renderer used in the directory combo box.
protected MetalFileChooserUI.FilterComboBoxModelcreateFilterComboBoxModel()
Creates and returns a new instance of {@link FilterComboBoxModel}.
protected MetalFileChooserUI.FilterComboBoxRenderercreateFilterComboBoxRenderer()
Creates and returns a new instance of {@link FilterComboBoxRenderer}.
protected JPanelcreateList(JFileChooser fc)
Creates a panel containing a list of files.
ListSelectionListenercreateListSelectionListener(JFileChooser fc)
Creates a listener that monitors selections in the directory/file list and keeps the {@link JFileChooser} component up to date.
PropertyChangeListenercreatePropertyChangeListener(JFileChooser fc)
Creates a property change listener that monitors the {@link JFileChooser} for property change events and updates the component display accordingly.
static ComponentUIcreateUI(JComponent c)
A factory method that returns a UI delegate for the specified component.
protected ActionMapgetActionMap()
protected JButtongetApproveButton(JFileChooser fc)
Returns the approve button.
protected JPanelgetBottomPanel()
Creates and returns a new panel that will be used for the controls at the bottom of the file chooser.
protected JPanelgetButtonPanel()
Returns the panel that contains the 'Open' (or 'Save') and 'Cancel' buttons.
StringgetFileName()
Returns the file name in the text field.
DimensiongetMaximumSize(JComponent c)
Returns the maximum size for the file chooser component.
DimensiongetMinimumSize(JComponent c)
Returns the minimum size for the file chooser component.
DimensiongetPreferredSize(JComponent c)
Returns the preferred size for the file chooser component.
voidinstallComponents(JFileChooser fc)
Installs the sub-components of the file chooser.
protected voidinstallListeners(JFileChooser fc)
Installs the listeners required.
protected voidinstallStrings(JFileChooser fc)
Fetches localised strings for use by the labels and buttons on the file chooser.
voidinstallUI(JComponent c)
protected voidremoveControlButtons()
Removes all the buttons from the control panel.
voidrescanCurrentDirectory(JFileChooser fc)
Updates the current directory.
voidsetFileName(String filename)
Sets the file name in the text field.
voiduninstallComponents(JFileChooser fc)
Uninstalls the components added by {@link #installComponents(JFileChooser)}.
protected voiduninstallListeners(JFileChooser fc)
voiduninstallUI(JComponent c)
voidvalueChanged(ListSelectionEvent e)
DOCUMENT ME!

Constructor Detail

MetalFileChooserUI

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

Parameters: filechooser the file chooser component.

Method Detail

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 {@link DirectoryComboBoxModel}.

Returns: A new instance of {@link DirectoryComboBoxModel}.

createDirectoryComboBoxRenderer

protected 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 {@link FilterComboBoxModel}.

Returns: A new instance of {@link FilterComboBoxModel}.

createFilterComboBoxRenderer

protected MetalFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer()
Creates and returns a new instance of {@link FilterComboBoxRenderer}.

Returns: A new instance of {@link 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 {@link JFileChooser} component up to date.

Parameters: fc the file chooser.

Returns: The listener.

See Also: installListeners

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
Creates a property change listener that monitors the {@link JFileChooser} for property change events and updates the component display accordingly.

Parameters: fc the file chooser.

Returns: The property change listener.

See Also: installListeners

createUI

public static ComponentUI createUI(JComponent c)
A factory method that returns a UI delegate for the specified component.

Parameters: c the component (which should be a {@link JFileChooser}).

getActionMap

protected ActionMap getActionMap()

getApproveButton

protected JButton getApproveButton(JFileChooser fc)
Returns the approve button.

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.

Returns: The file name.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Returns the maximum size for the file chooser component.

Returns: The maximum size.

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Returns the minimum size for the file chooser component.

Returns: The minimum size.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Returns the preferred size for the file chooser component.

Returns: The preferred size.

installComponents

public void installComponents(JFileChooser fc)
Installs the sub-components of the file chooser.

Parameters: fc the file chooser component.

installListeners

protected void installListeners(JFileChooser fc)
Installs the listeners required.

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.

Parameters: fc the file chooser.

installUI

public void installUI(JComponent c)

removeControlButtons

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

rescanCurrentDirectory

public void rescanCurrentDirectory(JFileChooser fc)
Updates the current directory.

Parameters: fc the file chooser to update.

setFileName

public void setFileName(String filename)
Sets the file name in the text field.

Parameters: filename the file name.

uninstallComponents

public void uninstallComponents(JFileChooser fc)
Uninstalls the components added by {@link #installComponents(JFileChooser)}.

Parameters: fc the file chooser.

uninstallListeners

protected void uninstallListeners(JFileChooser fc)

uninstallUI

public void uninstallUI(JComponent c)

valueChanged

public void valueChanged(ListSelectionEvent e)
DOCUMENT ME!!

Parameters: e - DOCUMENT ME!