|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
private class |
MetalFileChooserUI.AlignedLabel
|
private static class |
MetalFileChooserUI.ButtonAreaLayout
ButtonAreaLayout behaves in a similar manner to
FlowLayout . |
private class |
MetalFileChooserUI.DelayedSelectionUpdater
|
(package private) class |
MetalFileChooserUI.DetailsTableCellRenderer
|
(package private) class |
MetalFileChooserUI.DetailsTableModel
|
protected class |
MetalFileChooserUI.DirectoryComboBoxAction
Acts when DirectoryComboBox has changed the selected item. |
protected class |
MetalFileChooserUI.DirectoryComboBoxModel
Data model for a type-face selection combo-box. |
(package private) class |
MetalFileChooserUI.DirectoryComboBoxRenderer
|
(package private) class |
MetalFileChooserUI.EditActionListener
|
protected class |
MetalFileChooserUI.FileRenderer
|
protected class |
MetalFileChooserUI.FilterComboBoxModel
Data model for a type-face selection combo-box. |
class |
MetalFileChooserUI.FilterComboBoxRenderer
Render different type sizes and styles. |
(package private) class |
MetalFileChooserUI.IndentIcon
|
protected class |
MetalFileChooserUI.SingleClickListener
|
Constructor Summary | |
MetalFileChooserUI(JFileChooser filechooser)
|
Method Summary | |
protected void |
addControlButtons()
|
private void |
applyEdit()
|
private void |
cancelEdit()
|
protected ActionMap |
createActionMap()
|
protected JPanel |
createDetailsView(JFileChooser fc)
|
protected MetalFileChooserUI.DirectoryComboBoxModel |
createDirectoryComboBoxModel(JFileChooser fc)
|
protected MetalFileChooserUI.DirectoryComboBoxRenderer |
createDirectoryComboBoxRenderer(JFileChooser fc)
|
protected MetalFileChooserUI.FilterComboBoxModel |
createFilterComboBoxModel()
|
protected MetalFileChooserUI.FilterComboBoxRenderer |
createFilterComboBoxRenderer()
|
protected JPanel |
createList(JFileChooser fc)
|
ListSelectionListener |
createListSelectionListener(JFileChooser fc)
Creates a selection listener for the list of files and directories. |
java.beans.PropertyChangeListener |
createPropertyChangeListener(JFileChooser fc)
|
private MouseListener |
createSingleClickListener(JFileChooser fc,
JList list)
|
static ComponentUI |
createUI(JComponent c)
Returns an instance of the UI delegate for the specified component. |
private void |
doAccessoryChanged(java.beans.PropertyChangeEvent e)
|
private void |
doApproveButtonMnemonicChanged(java.beans.PropertyChangeEvent e)
|
private void |
doApproveButtonTextChanged(java.beans.PropertyChangeEvent e)
|
private void |
doControlButtonsChanged(java.beans.PropertyChangeEvent e)
|
private void |
doDialogTypeChanged(java.beans.PropertyChangeEvent e)
|
private void |
doDirectoryChanged(java.beans.PropertyChangeEvent e)
|
private void |
doFileSelectionModeChanged(java.beans.PropertyChangeEvent e)
|
private void |
doFilterChanged(java.beans.PropertyChangeEvent e)
|
private void |
doMultiSelectionChanged(java.beans.PropertyChangeEvent e)
|
private void |
doSelectedFileChanged(java.beans.PropertyChangeEvent e)
|
private void |
doSelectedFilesChanged(java.beans.PropertyChangeEvent e)
|
private void |
editFileName(int index)
|
void |
ensureFileIsVisible(JFileChooser fc,
File f)
|
private void |
ensureIndexIsVisible(int i)
|
private String |
fileNameString(File file)
|
private String |
fileNameString(File[] files)
|
private void |
fixNameColumnWidth(int viewWidth)
|
protected ActionMap |
getActionMap()
|
protected JButton |
getApproveButton(JFileChooser fc)
|
protected JPanel |
getBottomPanel()
|
protected JPanel |
getButtonPanel()
|
String |
getDirectoryName()
|
private int |
getEditIndex()
|
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 .
|
private static void |
groupLabels(MetalFileChooserUI.AlignedLabel[] group)
|
void |
installComponents(JFileChooser fc)
|
protected void |
installListeners(JFileChooser fc)
|
protected void |
installStrings(JFileChooser fc)
|
void |
installUI(JComponent c)
Configures the specified component appropriate for the look and feel. |
protected void |
removeControlButtons()
|
void |
rescanCurrentDirectory(JFileChooser fc)
|
private void |
resetEditIndex()
|
void |
setDirectoryName(String dirname)
|
protected void |
setDirectorySelected(boolean directorySelected)
Property to remember whether a directory is currently selected in the UI. |
private void |
setEditIndex(int i)
|
void |
setFileName(String filename)
|
(package private) void |
setFileSelected()
|
void |
uninstallComponents(JFileChooser fc)
|
void |
uninstallUI(JComponent c)
Reverses configuration which was done on the specified component during installUI . |
private void |
updateUseShellFolder()
|
void |
valueChanged(ListSelectionEvent e)
|
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 |
Field Detail |
private JPanel centerPanel
private JLabel lookInLabel
private JComboBox directoryComboBox
private MetalFileChooserUI.DirectoryComboBoxModel directoryComboBoxModel
private Action directoryComboBoxAction
private MetalFileChooserUI.FilterComboBoxModel filterComboBoxModel
private JTextField fileNameTextField
private JToggleButton listViewButton
private JToggleButton detailsViewButton
private JPanel listViewPanel
private JPanel detailsViewPanel
private JPanel currentViewPanel
private FocusListener editorFocusListener
private boolean useShellFolder
private ListSelectionModel listSelectionModel
private JList list
private JTable detailsTable
private JButton approveButton
private JButton cancelButton
private JPanel buttonPanel
private JPanel bottomPanel
private JComboBox filterComboBox
private static final Dimension hstrut5
private static final Dimension hstrut11
private static final Dimension vstrut5
private static final Insets shrinkwrap
private static int PREF_WIDTH
private static int PREF_HEIGHT
private static Dimension PREF_SIZE
private static int MIN_WIDTH
private static int MIN_HEIGHT
private static Dimension MIN_SIZE
private static int LIST_PREF_WIDTH
private static int LIST_PREF_HEIGHT
private static Dimension LIST_PREF_SIZE
private static final int COLUMN_FILENAME
private static final int COLUMN_FILESIZE
private static final int COLUMN_FILETYPE
private static final int COLUMN_FILEDATE
private static final int COLUMN_FILEATTR
private static final int COLUMN_COLCOUNT
private int[] COLUMN_WIDTHS
private int lookInLabelMnemonic
private String lookInLabelText
private String saveInLabelText
private int fileNameLabelMnemonic
private String fileNameLabelText
private int filesOfTypeLabelMnemonic
private String filesOfTypeLabelText
private String upFolderToolTipText
private String upFolderAccessibleName
private String homeFolderToolTipText
private String homeFolderAccessibleName
private String newFolderToolTipText
private String newFolderAccessibleName
private String listViewButtonToolTipText
private String listViewButtonAccessibleName
private String detailsViewButtonToolTipText
private String detailsViewButtonAccessibleName
private String fileNameHeaderText
private String fileSizeHeaderText
private String fileTypeHeaderText
private String fileDateHeaderText
private String fileAttrHeaderText
int lastIndex
File editFile
int editX
JTextField editCell
static final int space
Constructor Detail |
public MetalFileChooserUI(JFileChooser filechooser)
Method Detail |
public static ComponentUI createUI(JComponent c)
ComponentUI
createUI
method that returns an instance of that UI delegate subclass.
If the UI delegate subclass is stateless, it may return an instance
that is shared by multiple components. If the UI delegate is
stateful, then it should return a new instance per component.
The default implementation of this method throws an error, as it
should never be invoked.
public void installUI(JComponent c)
ComponentUI
ComponentUI
instance is being installed
as the UI delegate on the specified component. This method should
completely configure the component for the look and feel,
including the following:
LayoutManager
on the component if necessary.
PropertyChangeListener
on the component in order
to detect and respond to component property changes appropriately.
installUI
in class BasicFileChooserUI
public void uninstallComponents(JFileChooser fc)
uninstallComponents
in class BasicFileChooserUI
public void installComponents(JFileChooser fc)
installComponents
in class BasicFileChooserUI
private void updateUseShellFolder()
protected JPanel getButtonPanel()
protected JPanel getBottomPanel()
protected void installStrings(JFileChooser fc)
installStrings
in class BasicFileChooserUI
protected void installListeners(JFileChooser fc)
installListeners
in class BasicFileChooserUI
protected ActionMap getActionMap()
protected ActionMap createActionMap()
protected JPanel createList(JFileChooser fc)
protected JPanel createDetailsView(JFileChooser fc)
private void fixNameColumnWidth(int viewWidth)
public ListSelectionListener createListSelectionListener(JFileChooser fc)
createListSelectionListener
in class BasicFileChooserUI
fc
- a JFileChooser
ListSelectionListener
private MouseListener createSingleClickListener(JFileChooser fc, JList list)
private int getEditIndex()
private void setEditIndex(int i)
private void resetEditIndex()
private void cancelEdit()
private void editFileName(int index)
private void applyEdit()
public void uninstallUI(JComponent c)
ComponentUI
installUI
. This method is invoked when this
UIComponent
instance is being removed as the UI delegate
for the specified component. This method should undo the
configuration performed in installUI
, being careful to
leave the JComponent
instance in a clean state (no
extraneous listeners, look-and-feel-specific property objects, etc.).
This should include the following:
uninstallUI
in class BasicFileChooserUI
public Dimension getPreferredSize(JComponent c)
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.
getPreferredSize
in class ComponentUI
c
- a JFileChooser
Dimension
specifying the preferred
width and height of the file chooserJComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMinimumSize(JComponent c)
JFileChooser
.
getMinimumSize
in class ComponentUI
c
- a JFileChooser
Dimension
specifying the minimum
width and height of the file chooserJComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
JFileChooser
.
getMaximumSize
in class ComponentUI
c
- a JFileChooser
Dimension
specifying the maximum
width and height of the file chooserJComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
void setFileSelected()
private String fileNameString(File file)
private String fileNameString(File[] files)
private void doSelectedFileChanged(java.beans.PropertyChangeEvent e)
private void doSelectedFilesChanged(java.beans.PropertyChangeEvent e)
private void doDirectoryChanged(java.beans.PropertyChangeEvent e)
private void doFilterChanged(java.beans.PropertyChangeEvent e)
private void doFileSelectionModeChanged(java.beans.PropertyChangeEvent e)
private void doMultiSelectionChanged(java.beans.PropertyChangeEvent e)
private void doAccessoryChanged(java.beans.PropertyChangeEvent e)
private void doApproveButtonTextChanged(java.beans.PropertyChangeEvent e)
private void doDialogTypeChanged(java.beans.PropertyChangeEvent e)
private void doApproveButtonMnemonicChanged(java.beans.PropertyChangeEvent e)
private void doControlButtonsChanged(java.beans.PropertyChangeEvent e)
public java.beans.PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
createPropertyChangeListener
in class BasicFileChooserUI
protected void removeControlButtons()
protected void addControlButtons()
private void ensureIndexIsVisible(int i)
public void ensureFileIsVisible(JFileChooser fc, File f)
ensureFileIsVisible
in class BasicFileChooserUI
public void rescanCurrentDirectory(JFileChooser fc)
rescanCurrentDirectory
in class BasicFileChooserUI
public String getFileName()
getFileName
in class BasicFileChooserUI
public void setFileName(String filename)
setFileName
in class BasicFileChooserUI
protected void setDirectorySelected(boolean directorySelected)
setDirectorySelected
in class BasicFileChooserUI
directorySelected
- if a directory is currently selected.public String getDirectoryName()
getDirectoryName
in class BasicFileChooserUI
public void setDirectoryName(String dirname)
setDirectoryName
in class BasicFileChooserUI
protected MetalFileChooserUI.DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc)
protected MetalFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc)
protected MetalFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer()
protected MetalFileChooserUI.FilterComboBoxModel createFilterComboBoxModel()
public void valueChanged(ListSelectionEvent e)
protected JButton getApproveButton(JFileChooser fc)
getApproveButton
in class BasicFileChooserUI
private static void groupLabels(MetalFileChooserUI.AlignedLabel[] group)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |