public class

BasicDirectoryModel

extends AbstractListModel
implements PropertyChangeListener
java.lang.Object
   ↳ javax.swing.AbstractListModel
     ↳ javax.swing.plaf.basic.BasicDirectoryModel

Class Overview

Basic implementation of a file list.

Summary

[Expand]
Inherited Fields
From class javax.swing.AbstractListModel
Public Constructors
BasicDirectoryModel(JFileChooser filechooser)
Public Methods
void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
boolean contains(Object o)
void fireContentsChanged()
Vector<File> getDirectories()
Object getElementAt(int index)
Vector<File> getFiles()
PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the property change listeners registered on this component.
int getSize()
int indexOf(Object o)
void intervalAdded(ListDataEvent e)
Obsolete - not used.
void intervalRemoved(ListDataEvent e)
Obsolete - not used.
void invalidateFileCache()
This method is used to interrupt file loading thread.
void propertyChange(PropertyChangeEvent e)
This method gets called when a bound property is changed.
void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list.
boolean renameFile(File oldFile, File newFile)
Renames a file in the underlying file system.
void validateFileCache()
Protected Methods
void firePropertyChange(String propertyName, Object oldValue, Object newValue)
Support for reporting bound property changes for boolean properties.
boolean lt(File a, File b)
void sort(Vector<? extends File> v)
[Expand]
Inherited Methods
From class javax.swing.AbstractListModel
From class java.lang.Object
From interface java.beans.PropertyChangeListener
From interface javax.swing.ListModel

Public Constructors

public BasicDirectoryModel (JFileChooser filechooser)

Public Methods

public void addPropertyChangeListener (PropertyChangeListener listener)

Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters
listener the property change listener to be added

public boolean contains (Object o)

public void fireContentsChanged ()

public Vector<File> getDirectories ()

public Object getElementAt (int index)

public Vector<File> getFiles ()

public PropertyChangeListener[] getPropertyChangeListeners ()

Returns an array of all the property change listeners registered on this component.

Returns
  • all of this component's PropertyChangeListeners or an empty array if no property change listeners are currently registered

public int getSize ()

public int indexOf (Object o)

public void intervalAdded (ListDataEvent e)

Obsolete - not used.

public void intervalRemoved (ListDataEvent e)

Obsolete - not used.

public void invalidateFileCache ()

This method is used to interrupt file loading thread.

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 removePropertyChangeListener (PropertyChangeListener listener)

Removes a PropertyChangeListener from the listener list.

If listener is null, no exception is thrown and no action is performed.

Parameters
listener the PropertyChangeListener to be removed

public boolean renameFile (File oldFile, File newFile)

Renames a file in the underlying file system.

Parameters
oldFile a File object representing the existing file
newFile a File object representing the desired new file name
Returns
  • true if rename succeeded, otherwise false

public void validateFileCache ()

Protected Methods

protected void firePropertyChange (String propertyName, Object oldValue, Object newValue)

Support for reporting bound property changes for boolean properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Parameters
propertyName the property whose value has changed
oldValue the property's previous value
newValue the property's new value

protected boolean lt (File a, File b)

protected void sort (Vector<? extends File> v)