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

Variable Index

 o command
 o directoryModel
The model of the directory shown by this JDirectoryPane
 o doubleClickCommand
 o doubleClickContainerCommand
 o listSelectionModel
The selection model of this JDirectoryPane
 o redirector
Listens to property changes from directoryModel and rebroadcasts them with this as the source
 o selListener
Listens to value changes from listSelectionModel, firing an action if appropriate

Constructor Index

 o JDirectoryPane()
Creates a JDirectoryPane on the user's home directory
 o JDirectoryPane(File)
Creates a JDirectoryPane on the given File
 o JDirectoryPane(String)
Creates a JDirectoryPane on the given path

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this JDirectoryPane
 o addKnownFileType(FileType)
 o canGoUp()
 o clearSelection()
Clears the selection - after calling this method isSelectionEmpty() will return true.
 o createDirectoryModel(File)
Override point for people who want to muck with the DirectoryModel
 o createRedirector()
Can be overridden by subclasses that want to specialize listening to property events from the model
 o createSelectionListener()
 o createSelectionModel()
Override point for people who want to muck with the ListSelectionModel
 o enumerateKnownFileTypes()
 o fireActionPerformed(String)
 o getActionCommand()
 o getCurrentDirectory()
 o getDefaultActionListener()
By default, the returned object is registered as a listener to this JDirectoryPane, waiting for a container to be double-clicked.
 o getDoubleClickCommand()
 o getDoubleClickContainerCommand()
 o getGoUpAction()
Convenient way to tell this JDirectoryPane to go up.
 o getHiddenRule()
 o getKnownFileTypes()
 o getListSelectionModel()
 o getModel()
 o getSelectedFile()
Returns the lead selected file or null
 o getSelectedFiles()
Returns the set of selected files, possibly empty, never null.
 o getTypedFile(String)
 o getTypedFile(String, String)
 o getTypedFiles()
 o getTypedFilesForDirectory(File)
 o getUI()
 o getUIClassID()
 o goUp()
 o isKnownFileType(FileType)
 o isSelectionEmpty()
Returns true if nothing is selected This is a convenience method that just delegates to the listSelectionModel.
 o performDoubleClick()
To be called by UIs on doubleclick.
 o removeActionListener(ActionListener)
Removes the specified action listener so that it no longer receives action events from this JDirectoryPane
 o setActionCommand(String)
Sets the command string used for general action events, dispatched on selection change.
 o setCurrentDirectory(File)
 o setDoubleClickCommand(String)
Sets the command string used for action events dispatched on double click of non-containers
 o setDoubleClickContainerCommand(String)
Sets the command string used for action events dispatched on double click of containers
 o setHiddenRule(FileType)
 o setKnownFileTypes(FileType[])
 o setModel(DirectoryModel)
Note that this is protected.
 o setSelectionModel(ListSelectionModel)
Note that this is protected.
 o setUI(DirectoryPaneUI)
 o updateUI()
Called to replace the UI with the latest version from the default UIFactory.

Variables

 o directoryModel
 protected DirectoryModel directoryModel
The model of the directory shown by this JDirectoryPane

 o listSelectionModel
 protected ListSelectionModel listSelectionModel
The selection model of this JDirectoryPane

 o redirector
 protected transient JDirectoryPane. Redirector redirector
Listens to property changes from directoryModel and rebroadcasts them with this as the source

 o selListener
 protected transient JDirectoryPane. SelListener selListener
Listens to value changes from listSelectionModel, firing an action if appropriate

 o command
 protected String command
 o doubleClickCommand
 protected String doubleClickCommand
 o doubleClickContainerCommand
 protected String doubleClickContainerCommand

Constructors

 o JDirectoryPane
 public JDirectoryPane()
Creates a JDirectoryPane on the user's home directory

 o JDirectoryPane
 public JDirectoryPane(String path)
Creates a JDirectoryPane on the given path

 o JDirectoryPane
 public JDirectoryPane(File directory)
Creates a JDirectoryPane on the given File

Methods

 o createDirectoryModel
 protected DirectoryModel createDirectoryModel(File directory)
Override point for people who want to muck with the DirectoryModel

 o createSelectionModel
 protected ListSelectionModel createSelectionModel()
Override point for people who want to muck with the ListSelectionModel

 o getGoUpAction
 public Action getGoUpAction()
Convenient way to tell this JDirectoryPane to go up.

 o 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());
 

 o performDoubleClick
 public void performDoubleClick()
To be called by UIs on doubleclick.

 o getSelectedFile
 public TypedFile getSelectedFile()
Returns the lead selected file or null

 o getSelectedFiles
 public Vector getSelectedFiles()
Returns the set of selected files, possibly empty, never null. Objects in vector are TypedFiles

 o 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
 o 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
 o getCurrentDirectory
 public File getCurrentDirectory()
 o setCurrentDirectory
 public void setCurrentDirectory(File dir)
 o getTypedFile
 public TypedFile getTypedFile(String path,
                               String name)
 o getTypedFile
 public TypedFile getTypedFile(String path)
 o getTypedFiles
 public Vector getTypedFiles()
 o getTypedFilesForDirectory
 public Vector getTypedFilesForDirectory(File dir)
 o canGoUp
 public boolean canGoUp()
 o goUp
 public void goUp()
 o setHiddenRule
 public void setHiddenRule(FileType rule)
 o getHiddenRule
 public FileType getHiddenRule()
 o addKnownFileType
 public void addKnownFileType(FileType type)
 o enumerateKnownFileTypes
 public Enumeration enumerateKnownFileTypes()
 o getKnownFileTypes
 public Vector getKnownFileTypes()
 o isKnownFileType
 public boolean isKnownFileType(FileType t)
 o setKnownFileTypes
 public void setKnownFileTypes(FileType types[])
 o getUI
 public DirectoryPaneUI getUI()
 o setUI
 public void setUI(DirectoryPaneUI ui)
 o updateUI
 public void updateUI()
Called to replace the UI with the latest version from the default UIFactory.

Overrides:
updateUI in class JComponent
 o getUIClassID
 public String getUIClassID()
Returns:
"DirectoryPaneUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o getModel
 public DirectoryModel getModel()
 o setModel
 protected void setModel(DirectoryModel newModel)
Note that this is protected. A JDirectoryPane does not like having its model switched out from under it.

 o getListSelectionModel
 public ListSelectionModel getListSelectionModel()
 o 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.

 o createRedirector
 protected JDirectoryPane. Redirector createRedirector()
Can be overridden by subclasses that want to specialize listening to property events from the model

 o createSelectionListener
 protected JDirectoryPane. SelListener createSelectionListener()
 o addActionListener
 public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this JDirectoryPane

Parameters:
l - the action listener
 o 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
 o fireActionPerformed
 protected void fireActionPerformed(String command)
 o setActionCommand
 public void setActionCommand(String command)
Sets the command string used for general action events, dispatched on selection change.

Parameters:
command - the command string
 o getActionCommand
 public String getActionCommand()
 o 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
 o getDoubleClickCommand
 public String getDoubleClickCommand()
 o 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
 o getDoubleClickContainerCommand
 public String getDoubleClickContainerCommand()

All Packages  Class Hierarchy  This Package  Previous  Next  Index