org.jvnet.substance
Class SubstanceFileChooserUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.FileChooserUI
          extended by javax.swing.plaf.basic.BasicFileChooserUI
              extended by org.jvnet.substance.SubstanceFileChooserUI

public class SubstanceFileChooserUI
extends BasicFileChooserUI

UI for file choosers in Substance look and feel.

Author:
Kirill Grouchnikov

Nested Class Summary
protected  class SubstanceFileChooserUI.DirectoryComboBoxAction
          Acts when DirectoryComboBox has changed the selected item.
protected  class SubstanceFileChooserUI.DirectoryComboBoxModel
          Data model for a type-face selection combo-box.
protected  class SubstanceFileChooserUI.FilterComboBoxModel
          Data model for a type-face selection combo-box.
 class SubstanceFileChooserUI.FilterComboBoxRenderer
          Render different type sizes and styles.
 
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, updateButtonMnemonic, updateButtonText, updateButtonToolTipText, upFolderIcon
 
Constructor Summary
SubstanceFileChooserUI(JFileChooser filechooser)
           
 
Method Summary
protected  ActionMap createActionMap()
           
protected  JPanel createDetailsView(JFileChooser fc)
           
protected  SubstanceFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc)
           
protected  org.jvnet.substance.SubstanceFileChooserUI.DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc)
           
protected  SubstanceFileChooserUI.FilterComboBoxModel createFilterComboBoxModel()
           
protected  SubstanceFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer()
           
protected  JPanel createList(JFileChooser fc)
           
 ListSelectionListener createListSelectionListener(JFileChooser fc)
          Creates a selection listener for the list of files and directories.
 PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
           
static ComponentUI createUI(JComponent c)
           
 void ensureFileIsVisible(JFileChooser fc, File f)
           
protected  ActionMap getActionMap()
           
protected  JButton getApproveButton(JFileChooser fc)
           
 String getDirectoryName()
           
 String getFileName()
           
 Dimension getMaximumSize(JComponent c)
          Returns the maximum size of the JFileChooser.
 Dimension getMinimumSize(JComponent c)
          Returns the minimum size of the JFileChooser.
 Dimension getPreferredSize(JComponent c)
          Returns the preferred size of the specified JFileChooser.
 void installComponents(JFileChooser fc)
           
protected  void installListeners(JFileChooser fc)
           
protected  void installStrings(JFileChooser fc)
           
 void installUI(JComponent c)
           
 void rescanCurrentDirectory(JFileChooser fc)
           
 void setDirectoryName(String dirname)
           
protected  void setDirectorySelected(boolean directorySelected)
          Property to remember whether a directory is currently selected in the UI.
 void setFileName(String filename)
           
 void uninstallComponents(JFileChooser fc)
           
 void uninstallUI(JComponent c)
           
 void valueChanged(ListSelectionEvent e)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicFileChooserUI
clearIconCache, createDoubleClickListener, createModel, getAcceptAllFileFilter, getAccessoryPanel, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getApproveSelectionAction, getCancelSelectionAction, getChangeToParentDirectoryAction, getDialogTitle, getDirectory, getFileChooser, getFileView, getGoHomeAction, getModel, getNewFolderAction, getUpdateAction, installDefaults, installIcons, isDirectorySelected, setDirectory, uninstallDefaults, uninstallIcons, uninstallListeners, uninstallStrings
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubstanceFileChooserUI

public SubstanceFileChooserUI(JFileChooser filechooser)
Method Detail

createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
Overrides:
installUI in class BasicFileChooserUI

uninstallComponents

public void uninstallComponents(JFileChooser fc)
Overrides:
uninstallComponents in class BasicFileChooserUI

installComponents

public void installComponents(JFileChooser fc)
Overrides:
installComponents in class BasicFileChooserUI

installStrings

protected void installStrings(JFileChooser fc)
Overrides:
installStrings in class BasicFileChooserUI

installListeners

protected void installListeners(JFileChooser fc)
Overrides:
installListeners in class BasicFileChooserUI

getActionMap

protected ActionMap getActionMap()

createActionMap

protected ActionMap createActionMap()

createList

protected JPanel createList(JFileChooser fc)

createDetailsView

protected JPanel createDetailsView(JFileChooser fc)

createListSelectionListener

public ListSelectionListener createListSelectionListener(JFileChooser fc)
Creates a selection listener for the list of files and directories.

Overrides:
createListSelectionListener in class BasicFileChooserUI
Parameters:
fc - a JFileChooser
Returns:
a ListSelectionListener

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class BasicFileChooserUI

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 class ComponentUI
Parameters:
c - a JFileChooser
Returns:
a Dimension specifying the preferred width and height of the file chooser

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Returns the minimum size of the JFileChooser.

Overrides:
getMinimumSize in class ComponentUI
Parameters:
c - a JFileChooser
Returns:
a Dimension specifying the minimum width and height of the file chooser

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Returns the maximum size of the JFileChooser.

Overrides:
getMaximumSize in class ComponentUI
Parameters:
c - a JFileChooser
Returns:
a Dimension specifying the maximum width and height of the file chooser

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
Overrides:
createPropertyChangeListener in class BasicFileChooserUI

ensureFileIsVisible

public void ensureFileIsVisible(JFileChooser fc,
                                File f)
Overrides:
ensureFileIsVisible in class BasicFileChooserUI

rescanCurrentDirectory

public void rescanCurrentDirectory(JFileChooser fc)
Overrides:
rescanCurrentDirectory in class BasicFileChooserUI

getFileName

public String getFileName()
Overrides:
getFileName in class BasicFileChooserUI

setFileName

public void setFileName(String filename)
Overrides:
setFileName in class BasicFileChooserUI

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 class BasicFileChooserUI
Parameters:
directorySelected - if a directory is currently selected.
Since:
1.4

getDirectoryName

public String getDirectoryName()
Overrides:
getDirectoryName in class BasicFileChooserUI

setDirectoryName

public void setDirectoryName(String dirname)
Overrides:
setDirectoryName in class BasicFileChooserUI

createDirectoryComboBoxRenderer

protected org.jvnet.substance.SubstanceFileChooserUI.DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc)

createDirectoryComboBoxModel

protected SubstanceFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc)

createFilterComboBoxRenderer

protected SubstanceFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer()

createFilterComboBoxModel

protected SubstanceFileChooserUI.FilterComboBoxModel createFilterComboBoxModel()

valueChanged

public void valueChanged(ListSelectionEvent e)

getApproveButton

protected JButton getApproveButton(JFileChooser fc)
Overrides:
getApproveButton in class BasicFileChooserUI