public class

FilePane

extends JPanel
implements PropertyChangeListener
java.lang.Object
   ↳ java.awt.Component
     ↳ java.awt.Container
       ↳ javax.swing.JComponent
         ↳ javax.swing.JPanel
           ↳ sun.swing.FilePane

Class Overview

WARNING: This class is an implementation detail and is only public so that it can be used by two packages. You should NOT consider this public API.

This component is intended to be used in a subclass of javax.swing.plaf.basic.BasicFileChooserUI. It realies heavily on the implementation of BasicFileChooserUI, and is intended to be API compatible with earlier implementations of MetalFileChooserUI and WindowsFileChooserUI.

Summary

Nested Classes
interface FilePane.FileChooserUIAccessor  
class FilePane.FileRenderer  
Constants
String ACTION_APPROVE_SELECTION
String ACTION_CANCEL
String ACTION_CHANGE_TO_PARENT_DIRECTORY
String ACTION_EDIT_FILE_NAME
String ACTION_NEW_FOLDER
String ACTION_REFRESH
String ACTION_VIEW_DETAILS
String ACTION_VIEW_LIST
int VIEWTYPE_DETAILS
int VIEWTYPE_LIST
[Expand]
Inherited Constants
From class javax.swing.JComponent
From class java.awt.Component
From interface java.awt.image.ImageObserver
Fields
protected Action newFolderAction
[Expand]
Inherited Fields
From class javax.swing.JComponent
Public Constructors
FilePane(FilePane.FileChooserUIAccessor fileChooserUIAccessor)
Public Methods
static void addActionsToMap(ActionMap map, Action[] actions)
boolean canWrite(File f)
void clearSelection()
JPanel createDetailsView()
JPanel createList()
ListSelectionListener createListSelectionListener()
Creates a selection listener for the list of files and directories.
void ensureFileIsVisible(JFileChooser fc, File f)
Action[] getActions()
Fetches the command list for the FilePane.
JPopupMenu getComponentPopupMenu()
Returns JPopupMenu that assigned for this component.
Action getNewFolderAction()
JMenu getViewMenu()
int getViewType()
Action getViewTypeAction(int viewType)
void propertyChange(PropertyChangeEvent e)
This method gets called when a bound property is changed.
void rescanCurrentDirectory()
void setViewPanel(int viewType, JPanel viewPanel)
void setViewType(int viewType)
void uninstallUI()
Protected Methods
void createActionMap()
File getDirectory()
Property to remember the directory that is currently selected in the UI.
JFileChooser getFileChooser()
BasicDirectoryModel getModel()
FilePane.Handler getMouseHandler()
void installDefaults()
boolean isDirectorySelected()
Property to remember whether a directory is currently selected in the UI.
[Expand]
Inherited Methods
From class javax.swing.JPanel
From class javax.swing.JComponent
From class java.awt.Container
From class java.awt.Component
From class java.lang.Object
From interface java.awt.MenuContainer
From interface java.awt.image.ImageObserver
From interface java.beans.PropertyChangeListener
From interface javax.accessibility.Accessible

Constants

public static final String ACTION_APPROVE_SELECTION

Constant Value: "approveSelection"

public static final String ACTION_CANCEL

Constant Value: "cancelSelection"

public static final String ACTION_CHANGE_TO_PARENT_DIRECTORY

Constant Value: "Go Up"

public static final String ACTION_EDIT_FILE_NAME

Constant Value: "editFileName"

public static final String ACTION_NEW_FOLDER

Constant Value: "New Folder"

public static final String ACTION_REFRESH

Constant Value: "refresh"

public static final String ACTION_VIEW_DETAILS

Constant Value: "viewTypeDetails"

public static final String ACTION_VIEW_LIST

Constant Value: "viewTypeList"

public static final int VIEWTYPE_DETAILS

Constant Value: 1 (0x00000001)

public static final int VIEWTYPE_LIST

Constant Value: 0 (0x00000000)

Fields

protected Action newFolderAction

Public Constructors

public FilePane (FilePane.FileChooserUIAccessor fileChooserUIAccessor)

Public Methods

public static void addActionsToMap (ActionMap map, Action[] actions)

public boolean canWrite (File f)

public void clearSelection ()

public JPanel createDetailsView ()

public JPanel createList ()

public ListSelectionListener createListSelectionListener ()

Creates a selection listener for the list of files and directories.

Returns
  • a ListSelectionListener

public void ensureFileIsVisible (JFileChooser fc, File f)

public Action[] getActions ()

Fetches the command list for the FilePane. These commands are useful for binding to events, such as in a keymap.

Returns
  • the command list

public JPopupMenu getComponentPopupMenu ()

Returns JPopupMenu that assigned for this component. If this component does not have a JPopupMenu assigned to it and getInheritsPopupMenu is true, this will return getParent().getComponentPopupMenu() (assuming the parent is valid.)

Returns
  • JPopupMenu assigned for this component or null if no popup assigned

public Action getNewFolderAction ()

public JMenu getViewMenu ()

public int getViewType ()

public Action getViewTypeAction (int viewType)

public void propertyChange (PropertyChangeEvent e)

This method gets called when a bound property is changed.

Parameters
e A PropertyChangeEvent object describing the event source and the property that has changed.

public void rescanCurrentDirectory ()

public void setViewPanel (int viewType, JPanel viewPanel)

public void setViewType (int viewType)

public void uninstallUI ()

Protected Methods

protected void createActionMap ()

protected File getDirectory ()

Property to remember the directory that is currently selected in the UI.

Returns
  • the value of the directory property

protected JFileChooser getFileChooser ()

protected BasicDirectoryModel getModel ()

protected FilePane.Handler getMouseHandler ()

protected void installDefaults ()

protected boolean isDirectorySelected ()

Property to remember whether a directory is currently selected in the UI.

Returns
  • true iff a directory is currently selected.