All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JDirectoryPane
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JDirectoryPane
- public class JDirectoryPane
- extends JComponent
- implements SwingConstants
-
command
-
-
directoryModel
- The model of the directory shown by this JDirectoryPane
-
doubleClickCommand
-
-
doubleClickContainerCommand
-
-
listSelectionModel
- The selection model of this JDirectoryPane
-
redirector
- Listens to property changes from directoryModel
and rebroadcasts them with this as the source
-
selListener
- Listens to value changes from listSelectionModel,
firing an action if appropriate
-
JDirectoryPane()
- Creates a JDirectoryPane on the user's home directory
-
JDirectoryPane(File)
- Creates a JDirectoryPane on the given File
-
JDirectoryPane(String)
- Creates a JDirectoryPane on the given path
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events
from this JDirectoryPane
-
addKnownFileType(FileType)
-
-
canGoUp()
-
-
clearSelection()
- Clears the selection - after calling this method
isSelectionEmpty() will return true.
-
createDirectoryModel(File)
- Override point for people who want to muck with the DirectoryModel
-
createRedirector()
- Can be overridden by subclasses that want to specialize
listening to property events from the model
-
createSelectionListener()
-
-
createSelectionModel()
- Override point for people who want to muck with the ListSelectionModel
-
enumerateKnownFileTypes()
-
-
fireActionPerformed(String)
-
-
getActionCommand()
-
-
getCurrentDirectory()
-
-
getDefaultActionListener()
- By default, the returned object is registered as a listener to
this JDirectoryPane, waiting for a container to be double-clicked.
-
getDoubleClickCommand()
-
-
getDoubleClickContainerCommand()
-
-
getGoUpAction()
- Convenient way to tell this JDirectoryPane to go up.
-
getHiddenRule()
-
-
getKnownFileTypes()
-
-
getListSelectionModel()
-
-
getModel()
-
-
getSelectedFile()
- Returns the lead selected file or null
-
getSelectedFiles()
- Returns the set of selected files, possibly empty, never null.
-
getTypedFile(String)
-
-
getTypedFile(String, String)
-
-
getTypedFiles()
-
-
getTypedFilesForDirectory(File)
-
-
getUI()
-
-
getUIClassID()
-
-
goUp()
-
-
isKnownFileType(FileType)
-
-
isSelectionEmpty()
- Returns true if nothing is selected This is a convenience
method that just delegates to the listSelectionModel.
-
performDoubleClick()
- To be called by UIs on doubleclick.
-
removeActionListener(ActionListener)
- Removes the specified action listener so that it no longer
receives action events from this JDirectoryPane
-
setActionCommand(String)
- Sets the command string used for general action events, dispatched on
selection change.
-
setCurrentDirectory(File)
-
-
setDoubleClickCommand(String)
- Sets the command string used for action events dispatched on
double click of non-containers
-
setDoubleClickContainerCommand(String)
- Sets the command string used for action events dispatched on
double click of containers
-
setHiddenRule(FileType)
-
-
setKnownFileTypes(FileType[])
-
-
setModel(DirectoryModel)
- Note that this is protected.
-
setSelectionModel(ListSelectionModel)
- Note that this is protected.
-
setUI(DirectoryPaneUI)
-
-
updateUI()
- Called to replace the UI with the latest version from the
default UIFactory.
directoryModel
protected DirectoryModel directoryModel
- The model of the directory shown by this JDirectoryPane
listSelectionModel
protected ListSelectionModel listSelectionModel
- The selection model of this JDirectoryPane
redirector
protected transient JDirectoryPane. Redirector redirector
- Listens to property changes from directoryModel
and rebroadcasts them with this as the source
selListener
protected transient JDirectoryPane. SelListener selListener
- Listens to value changes from listSelectionModel,
firing an action if appropriate
command
protected String command
doubleClickCommand
protected String doubleClickCommand
doubleClickContainerCommand
protected String doubleClickContainerCommand
JDirectoryPane
public JDirectoryPane()
- Creates a JDirectoryPane on the user's home directory
JDirectoryPane
public JDirectoryPane(String path)
- Creates a JDirectoryPane on the given path
JDirectoryPane
public JDirectoryPane(File directory)
- Creates a JDirectoryPane on the given File
createDirectoryModel
protected DirectoryModel createDirectoryModel(File directory)
- Override point for people who want to muck with the DirectoryModel
createSelectionModel
protected ListSelectionModel createSelectionModel()
- Override point for people who want to muck with the ListSelectionModel
getGoUpAction
public Action getGoUpAction()
- Convenient way to tell this JDirectoryPane to go up.
getDefaultActionListener
public ActionListener getDefaultActionListener()
- By default, the returned object is registered as a listener to
this JDirectoryPane, waiting for a container to be double-clicked.
To defeat this behavior, do something like
myDirPane.removeActionListener(myDirPane.getDefaultActionListener());
performDoubleClick
public void performDoubleClick()
- To be called by UIs on doubleclick.
getSelectedFile
public TypedFile getSelectedFile()
- Returns the lead selected file or null
getSelectedFiles
public Vector getSelectedFiles()
- Returns the set of selected files, possibly empty, never null.
Objects in vector are TypedFiles
isSelectionEmpty
public boolean isSelectionEmpty()
- Returns true if nothing is selected This is a convenience
method that just delegates to the listSelectionModel.
- Returns:
- True if nothing is selected
- See Also:
- isSelectionEmpty, clearSelection, addListSelectionListener
clearSelection
public void clearSelection()
- Clears the selection - after calling this method
isSelectionEmpty() will return true. This is a convenience
method that just delegates to the listSelectionModel.
- See Also:
- clearSelection, isSelectionEmpty, addListSelectionListener
getCurrentDirectory
public File getCurrentDirectory()
setCurrentDirectory
public void setCurrentDirectory(File dir)
getTypedFile
public TypedFile getTypedFile(String path,
String name)
getTypedFile
public TypedFile getTypedFile(String path)
getTypedFiles
public Vector getTypedFiles()
getTypedFilesForDirectory
public Vector getTypedFilesForDirectory(File dir)
canGoUp
public boolean canGoUp()
goUp
public void goUp()
setHiddenRule
public void setHiddenRule(FileType rule)
getHiddenRule
public FileType getHiddenRule()
addKnownFileType
public void addKnownFileType(FileType type)
enumerateKnownFileTypes
public Enumeration enumerateKnownFileTypes()
getKnownFileTypes
public Vector getKnownFileTypes()
isKnownFileType
public boolean isKnownFileType(FileType t)
setKnownFileTypes
public void setKnownFileTypes(FileType types[])
getUI
public DirectoryPaneUI getUI()
setUI
public void setUI(DirectoryPaneUI ui)
updateUI
public void updateUI()
- Called to replace the UI with the latest version from the
default UIFactory.
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "DirectoryPaneUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
getModel
public DirectoryModel getModel()
setModel
protected void setModel(DirectoryModel newModel)
- Note that this is protected. A JDirectoryPane does not
like having its model switched out from under it.
getListSelectionModel
public ListSelectionModel getListSelectionModel()
setSelectionModel
protected void setSelectionModel(ListSelectionModel newModel)
- Note that this is protected. A JDirectoryPane does not
like having its selection model switched out from under it.
createRedirector
protected JDirectoryPane. Redirector createRedirector()
- Can be overridden by subclasses that want to specialize
listening to property events from the model
createSelectionListener
protected JDirectoryPane. SelListener createSelectionListener()
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds the specified action listener to receive action events
from this JDirectoryPane
- Parameters:
- l - the action listener
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes the specified action listener so that it no longer
receives action events from this JDirectoryPane
- Parameters:
- l - the action listener
fireActionPerformed
protected void fireActionPerformed(String command)
setActionCommand
public void setActionCommand(String command)
- Sets the command string used for general action events, dispatched on
selection change.
- Parameters:
- command - the command string
getActionCommand
public String getActionCommand()
setDoubleClickCommand
public void setDoubleClickCommand(String command)
- Sets the command string used for action events dispatched on
double click of non-containers
- Parameters:
- command - the command string
getDoubleClickCommand
public String getDoubleClickCommand()
setDoubleClickContainerCommand
public void setDoubleClickContainerCommand(String command)
- Sets the command string used for action events dispatched on
double click of containers
- Parameters:
- command - the command string
getDoubleClickContainerCommand
public String getDoubleClickContainerCommand()
All Packages Class Hierarchy This Package Previous Next Index