|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.FileChooserUI
javax.swing.plaf.basic.BasicFileChooserUI
public class BasicFileChooserUI
A UI delegate for the JFileChooser
component under the
BasicLookAndFeel
.
Nested Class Summary | |
---|---|
protected class |
BasicFileChooserUI.AcceptAllFileFilter
A file filter that accepts all files. |
protected class |
BasicFileChooserUI.ApproveSelectionAction
Handles a user action to approve the dialog selection. |
protected class |
BasicFileChooserUI.BasicFileView
Provides presentation information about files and directories. |
protected class |
BasicFileChooserUI.CancelSelectionAction
Handles an action to cancel the file chooser. |
protected class |
BasicFileChooserUI.ChangeToParentDirectoryAction
An action to handle changes to the parent directory (for example, via a click on the "up folder" button). |
protected class |
BasicFileChooserUI.DoubleClickListener
A mouse listener that handles double-click events. |
protected class |
BasicFileChooserUI.GoHomeAction
An action that changes the file chooser to display the user's home directory. |
protected class |
BasicFileChooserUI.NewFolderAction
An action that handles the creation of a new folder/directory. |
protected class |
BasicFileChooserUI.SelectionListener
A listener for selection events in the file list. |
protected class |
BasicFileChooserUI.UpdateAction
DOCUMENT ME! |
Field Summary | |
---|---|
protected int |
cancelButtonMnemonic
The localised mnemonic for the cancel button. |
protected String |
cancelButtonText
The localised text for the cancel button. |
protected String |
cancelButtonToolTipText
The localised tool tip text for the cancel button. |
protected Icon |
computerIcon
An icon representing a computer. |
protected Icon |
detailsViewIcon
An icon for the "details view" button. |
protected Icon |
directoryIcon
An icon representing a directory. |
protected int |
directoryOpenButtonMnemonic
The localised Mnemonic for the open button. |
protected String |
directoryOpenButtonText
The localised text for the open button. |
protected String |
directoryOpenButtonToolTipText
The localised tool tip text for the open button. |
protected Icon |
fileIcon
An icon representing a file. |
protected Icon |
floppyDriveIcon
An icon representing a floppy drive. |
protected Icon |
hardDriveIcon
An icon representing a hard drive. |
protected int |
helpButtonMnemonic
The localised mnemonic for the "help" button. |
protected String |
helpButtonText
The localised text for the "help" button. |
protected String |
helpButtonToolTipText
The localised tool tip text for the help button. |
protected Icon |
homeFolderIcon
An icon representing the user's home folder. |
protected Icon |
listViewIcon
An icon for the "list view" button. |
protected Icon |
newFolderIcon
An icon for the "new folder" button. |
protected int |
openButtonMnemonic
The localised mnemonic for the "open" button. |
protected String |
openButtonText
The localised text for the "open" button. |
protected String |
openButtonToolTipText
The localised tool tip text for the "open" button. |
protected int |
saveButtonMnemonic
The localised mnemonic for the "save" button. |
protected String |
saveButtonText
The localised text for the "save" button. |
protected String |
saveButtonToolTipText
The localised tool tip text for the save button. |
protected int |
updateButtonMnemonic
The localised mnemonic for the "update" button. |
protected String |
updateButtonText
The localised text for the "update" button. |
protected String |
updateButtonToolTipText
The localised tool tip text for the "update" button. |
protected Icon |
upFolderIcon
An icon for the "up folder" button. |
Constructor Summary | |
---|---|
BasicFileChooserUI(JFileChooser b)
Creates a new BasicFileChooserUI object. |
Method Summary | |
---|---|
void |
clearIconCache()
Clears the icon cache. |
protected MouseListener |
createDoubleClickListener(JFileChooser fc,
JList list)
Creates a new listener to handle double-click events. |
ListSelectionListener |
createListSelectionListener(JFileChooser fc)
Creates a new listener to handle selections in the file list. |
protected void |
createModel()
Creates a new directory model. |
PropertyChangeListener |
createPropertyChangeListener(JFileChooser fc)
Creates a listener to handle changes to the properties of the given file chooser component. |
static ComponentUI |
createUI(JComponent c)
Returns a UI delegate for the given component. |
void |
ensureFileIsVisible(JFileChooser fc,
File f)
NOT YET IMPLEMENTED. |
FileFilter |
getAcceptAllFileFilter(JFileChooser fc)
Returns the "accept all" file filter. |
JPanel |
getAccessoryPanel()
Returns the optional accessory panel. |
protected JButton |
getApproveButton(JFileChooser fc)
Returns the approve (open or save) button for the dialog. |
int |
getApproveButtonMnemonic(JFileChooser fc)
Returns the approve button mnemonic. |
String |
getApproveButtonText(JFileChooser fc)
Returns the approve button text. |
String |
getApproveButtonToolTipText(JFileChooser fc)
Returns the tool tip text for the approve (open/save) button. |
Action |
getApproveSelectionAction()
Returns the action that handles events for the "approve" button. |
Action |
getCancelSelectionAction()
Returns the action that handles events for the "cancel" button. |
Action |
getChangeToParentDirectoryAction()
Returns the action that handles events for the "up folder" control button. |
String |
getDialogTitle(JFileChooser fc)
Returns the dialog title. |
protected File |
getDirectory()
Returns the current directory. |
String |
getDirectoryName()
Returns the current directory name. |
JFileChooser |
getFileChooser()
Returns the JFileChooser component that this UI delegate
represents. |
String |
getFileName()
Returns the current file name. |
FileView |
getFileView(JFileChooser fc)
Returns the default file view (NOT the file view from the file chooser, if there is one). |
Action |
getGoHomeAction()
Creates and returns a new action that will be used with the "home folder" button. |
BasicDirectoryModel |
getModel()
Returns the directory model. |
Action |
getNewFolderAction()
Creates and returns a new action that will be used with the "new folder" button. |
Action |
getUpdateAction()
Returns the update action (an instance of BasicFileChooserUI.UpdateAction ). |
void |
installComponents(JFileChooser fc)
Creates and install the subcomponents for the file chooser. |
protected void |
installDefaults(JFileChooser fc)
Installs the defaults for this UI delegate. |
protected void |
installIcons(JFileChooser fc)
Installs the icons for this UI delegate. |
protected void |
installListeners(JFileChooser fc)
Installs the listeners required by this UI delegate. |
protected void |
installStrings(JFileChooser fc)
Installs the strings used by this UI delegate. |
void |
installUI(JComponent c)
Installs the UI for the specified component. |
protected boolean |
isDirectorySelected()
Returns true if a directory is selected, and
false otherwise. |
void |
rescanCurrentDirectory(JFileChooser fc)
Rescans the current directory. |
protected void |
setDirectory(File f)
Sets the current directory. |
void |
setDirectoryName(String dirname)
Sets the directory name (NOT IMPLEMENTED). |
protected void |
setDirectorySelected(boolean selected)
Sets the flag that indicates whether the current directory is selected. |
void |
setFileName(String filename)
Sets the file name. |
void |
uninstallComponents(JFileChooser fc)
Uninstalls the components from the file chooser. |
protected void |
uninstallDefaults(JFileChooser fc)
Uninstalls the defaults previously added by this UI delegate. |
protected void |
uninstallIcons(JFileChooser fc)
Uninstalls the icons previously added by this UI delegate. |
protected void |
uninstallListeners(JFileChooser fc)
Uninstalls the listeners previously installed by this UI delegate. |
protected void |
uninstallStrings(JFileChooser fc)
Uninstalls the strings previously added by this UI delegate. |
void |
uninstallUI(JComponent c)
Uninstalls this UI from the given component. |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int cancelButtonMnemonic
protected String cancelButtonText
protected String cancelButtonToolTipText
protected Icon computerIcon
protected Icon detailsViewIcon
protected Icon directoryIcon
protected int directoryOpenButtonMnemonic
protected String directoryOpenButtonText
protected String directoryOpenButtonToolTipText
protected Icon fileIcon
protected Icon floppyDriveIcon
protected Icon hardDriveIcon
protected int helpButtonMnemonic
protected String helpButtonText
protected String helpButtonToolTipText
protected Icon homeFolderIcon
protected Icon listViewIcon
protected Icon newFolderIcon
protected int openButtonMnemonic
protected String openButtonText
protected String openButtonToolTipText
protected int saveButtonMnemonic
protected String saveButtonText
protected String saveButtonToolTipText
protected int updateButtonMnemonic
protected String updateButtonText
protected String updateButtonToolTipText
protected Icon upFolderIcon
Constructor Detail |
---|
public BasicFileChooserUI(JFileChooser b)
BasicFileChooserUI
object.
b
- the file chooser component.Method Detail |
---|
public static ComponentUI createUI(JComponent c)
c
- the component (should be a JFileChooser
).
public void installUI(JComponent c)
installUI
in class ComponentUI
c
- the component (should be a JFileChooser
).ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
c
- the component (should be a JFileChooser
).ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void installComponents(JFileChooser fc)
fc
- the file chooser.public void uninstallComponents(JFileChooser fc)
fc
- the file chooser.protected void installListeners(JFileChooser fc)
fc
- the file chooser.protected void uninstallListeners(JFileChooser fc)
fc
- the file chooser.protected void installDefaults(JFileChooser fc)
fc
- the file chooser.protected void uninstallDefaults(JFileChooser fc)
fc
- the file chooser.protected void installIcons(JFileChooser fc)
fc
- the file chooser (ignored).protected void uninstallIcons(JFileChooser fc)
fc
- the file chooser.protected void installStrings(JFileChooser fc)
fc
- the file chooser.protected void uninstallStrings(JFileChooser fc)
fc
- the file chooser.protected void createModel()
public BasicDirectoryModel getModel()
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
fc
- the file chooser component.
public String getFileName()
public String getDirectoryName()
setDirectoryName(String)
public void setFileName(String filename)
filename
- the file name.getFileName()
public void setDirectoryName(String dirname)
dirname
- the directory name.getDirectoryName()
public void rescanCurrentDirectory(JFileChooser fc)
rescanCurrentDirectory
in class FileChooserUI
fc
- the file chooser.public void ensureFileIsVisible(JFileChooser fc, File f)
ensureFileIsVisible
in class FileChooserUI
fc
- the file chooser.f
- the file.public JFileChooser getFileChooser()
JFileChooser
component that this UI delegate
represents.
public JPanel getAccessoryPanel()
protected JButton getApproveButton(JFileChooser fc)
fc
- the file chooser.
public String getApproveButtonToolTipText(JFileChooser fc)
fc
- the file chooser.
public void clearIconCache()
public ListSelectionListener createListSelectionListener(JFileChooser fc)
fc
- the file chooser component.
BasicFileChooserUI.SelectionListener
.protected MouseListener createDoubleClickListener(JFileChooser fc, JList list)
fc
- the file chooser component.list
- the list.
BasicFileChooserUI.DoubleClickListener
.protected boolean isDirectorySelected()
true
if a directory is selected, and
false
otherwise.
protected void setDirectorySelected(boolean selected)
selected
- the new flag value.protected File getDirectory()
protected void setDirectory(File f)
f
- the directory.public FileFilter getAcceptAllFileFilter(JFileChooser fc)
getAcceptAllFileFilter
in class FileChooserUI
fc
- the file chooser component.
JFileChooser.getAcceptAllFileFilter()
,
FileFilter.getDescription()
public FileView getFileView(JFileChooser fc)
getFileView
in class FileChooserUI
fc
- the file chooser component.
JFileChooser.getFileView()
public String getDialogTitle(JFileChooser fc)
getDialogTitle
in class FileChooserUI
fc
- the file chooser (null
not permitted).
JFileChooser.getDialogTitle()
public int getApproveButtonMnemonic(JFileChooser fc)
fc
- the file chooser (null
not permitted).
JFileChooser.getApproveButtonMnemonic()
public String getApproveButtonText(JFileChooser fc)
getApproveButtonText
in class FileChooserUI
fc
- the file chooser (null
not permitted).
JFileChooser.getApproveButtonText()
public Action getNewFolderAction()
BasicFileChooserUI.NewFolderAction
.public Action getGoHomeAction()
BasicFileChooserUI.GoHomeAction
.public Action getChangeToParentDirectoryAction()
BasicFileChooserUI.ChangeToParentDirectoryAction
.public Action getApproveSelectionAction()
BasicFileChooserUI.ApproveSelectionAction
.public Action getCancelSelectionAction()
BasicFileChooserUI.CancelSelectionAction
.public Action getUpdateAction()
BasicFileChooserUI.UpdateAction
).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |