javax.swing.plaf.basic
Class BasicDirectoryModel

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.AbstractListModel sample code for javax.swing.AbstractListModel definition code for javax.swing.AbstractListModel 
      extended by javax.swing.plaf.basic.BasicDirectoryModel
All Implemented Interfaces:
PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , EventListener sample code for java.util.EventListener definition code for java.util.EventListener , ListModel sample code for javax.swing.ListModel definition code for javax.swing.ListModel

public class BasicDirectoryModel
extends AbstractListModel sample code for javax.swing.AbstractListModel definition code for javax.swing.AbstractListModel
implements PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener

Basic implementation of a file list.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel sample code for javax.swing.AbstractListModel definition code for javax.swing.AbstractListModel
listenerList sample code for javax.swing.AbstractListModel.listenerList definition code for javax.swing.AbstractListModel.listenerList
 
Constructor Summary
BasicDirectoryModel sample code for javax.swing.plaf.basic.BasicDirectoryModel.BasicDirectoryModel(javax.swing.JFileChooser) definition code for javax.swing.plaf.basic.BasicDirectoryModel.BasicDirectoryModel(javax.swing.JFileChooser) (JFileChooser sample code for javax.swing.JFileChooser definition code for javax.swing.JFileChooser  filechooser)
           
 
Method Summary
 boolean contains sample code for javax.swing.plaf.basic.BasicDirectoryModel.contains(java.lang.Object) definition code for javax.swing.plaf.basic.BasicDirectoryModel.contains(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  o)
           
 void fireContentsChanged sample code for javax.swing.plaf.basic.BasicDirectoryModel.fireContentsChanged() definition code for javax.swing.plaf.basic.BasicDirectoryModel.fireContentsChanged() ()
           
 Vector sample code for java.util.Vector definition code for java.util.Vector <File sample code for java.io.File definition code for java.io.File > getDirectories sample code for javax.swing.plaf.basic.BasicDirectoryModel.getDirectories() definition code for javax.swing.plaf.basic.BasicDirectoryModel.getDirectories() ()
           
 Object sample code for java.lang.Object definition code for java.lang.Object getElementAt sample code for javax.swing.plaf.basic.BasicDirectoryModel.getElementAt(int) definition code for javax.swing.plaf.basic.BasicDirectoryModel.getElementAt(int) (int index)
          Returns the value at the specified index.
 Vector sample code for java.util.Vector definition code for java.util.Vector <File sample code for java.io.File definition code for java.io.File > getFiles sample code for javax.swing.plaf.basic.BasicDirectoryModel.getFiles() definition code for javax.swing.plaf.basic.BasicDirectoryModel.getFiles() ()
           
 int getSize sample code for javax.swing.plaf.basic.BasicDirectoryModel.getSize() definition code for javax.swing.plaf.basic.BasicDirectoryModel.getSize() ()
          Returns the length of the list.
 int indexOf sample code for javax.swing.plaf.basic.BasicDirectoryModel.indexOf(java.lang.Object) definition code for javax.swing.plaf.basic.BasicDirectoryModel.indexOf(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  o)
           
 void intervalAdded sample code for javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(javax.swing.event.ListDataEvent) definition code for javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(javax.swing.event.ListDataEvent) (ListDataEvent sample code for javax.swing.event.ListDataEvent definition code for javax.swing.event.ListDataEvent  e)
          Obsolete - not used.
 void intervalRemoved sample code for javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(javax.swing.event.ListDataEvent) definition code for javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(javax.swing.event.ListDataEvent) (ListDataEvent sample code for javax.swing.event.ListDataEvent definition code for javax.swing.event.ListDataEvent  e)
          Obsolete - not used.
 void invalidateFileCache sample code for javax.swing.plaf.basic.BasicDirectoryModel.invalidateFileCache() definition code for javax.swing.plaf.basic.BasicDirectoryModel.invalidateFileCache() ()
          Obsolete - not used.
protected  boolean lt sample code for javax.swing.plaf.basic.BasicDirectoryModel.lt(java.io.File, java.io.File) definition code for javax.swing.plaf.basic.BasicDirectoryModel.lt(java.io.File, java.io.File) (File sample code for java.io.File definition code for java.io.File  a, File sample code for java.io.File definition code for java.io.File  b)
           
 void propertyChange sample code for javax.swing.plaf.basic.BasicDirectoryModel.propertyChange(java.beans.PropertyChangeEvent) definition code for javax.swing.plaf.basic.BasicDirectoryModel.propertyChange(java.beans.PropertyChangeEvent) (PropertyChangeEvent sample code for java.beans.PropertyChangeEvent definition code for java.beans.PropertyChangeEvent  e)
          This method gets called when a bound property is changed.
 boolean renameFile sample code for javax.swing.plaf.basic.BasicDirectoryModel.renameFile(java.io.File, java.io.File) definition code for javax.swing.plaf.basic.BasicDirectoryModel.renameFile(java.io.File, java.io.File) (File sample code for java.io.File definition code for java.io.File  oldFile, File sample code for java.io.File definition code for java.io.File  newFile)
          Renames a file in the underlying file system.
protected  void sort sample code for javax.swing.plaf.basic.BasicDirectoryModel.sort(java.util.Vector) definition code for javax.swing.plaf.basic.BasicDirectoryModel.sort(java.util.Vector) (Vector sample code for java.util.Vector definition code for java.util.Vector <? extends File sample code for java.io.File definition code for java.io.File > v)
           
 void validateFileCache sample code for javax.swing.plaf.basic.BasicDirectoryModel.validateFileCache() definition code for javax.swing.plaf.basic.BasicDirectoryModel.validateFileCache() ()
           
 
Methods inherited from class javax.swing.AbstractListModel sample code for javax.swing.AbstractListModel definition code for javax.swing.AbstractListModel
addListDataListener sample code for javax.swing.AbstractListModel.addListDataListener(javax.swing.event.ListDataListener) definition code for javax.swing.AbstractListModel.addListDataListener(javax.swing.event.ListDataListener) , fireContentsChanged sample code for javax.swing.AbstractListModel.fireContentsChanged(java.lang.Object, int, int) definition code for javax.swing.AbstractListModel.fireContentsChanged(java.lang.Object, int, int) , fireIntervalAdded sample code for javax.swing.AbstractListModel.fireIntervalAdded(java.lang.Object, int, int) definition code for javax.swing.AbstractListModel.fireIntervalAdded(java.lang.Object, int, int) , fireIntervalRemoved sample code for javax.swing.AbstractListModel.fireIntervalRemoved(java.lang.Object, int, int) definition code for javax.swing.AbstractListModel.fireIntervalRemoved(java.lang.Object, int, int) , getListDataListeners sample code for javax.swing.AbstractListModel.getListDataListeners() definition code for javax.swing.AbstractListModel.getListDataListeners() , getListeners sample code for javax.swing.AbstractListModel.getListeners(java.lang.Class) definition code for javax.swing.AbstractListModel.getListeners(java.lang.Class) , removeListDataListener sample code for javax.swing.AbstractListModel.removeListDataListener(javax.swing.event.ListDataListener) definition code for javax.swing.AbstractListModel.removeListDataListener(javax.swing.event.ListDataListener)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

BasicDirectoryModel sample code for javax.swing.plaf.basic.BasicDirectoryModel(javax.swing.JFileChooser) definition code for javax.swing.plaf.basic.BasicDirectoryModel(javax.swing.JFileChooser)

public BasicDirectoryModel(JFileChooser sample code for javax.swing.JFileChooser definition code for javax.swing.JFileChooser  filechooser)
Method Detail

propertyChange sample code for javax.swing.plaf.basic.BasicDirectoryModel.propertyChange(java.beans.PropertyChangeEvent) definition code for javax.swing.plaf.basic.BasicDirectoryModel.propertyChange(java.beans.PropertyChangeEvent)

public void propertyChange(PropertyChangeEvent sample code for java.beans.PropertyChangeEvent definition code for java.beans.PropertyChangeEvent  e)
Description copied from interface: PropertyChangeListener sample code for java.beans.PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent) definition code for java.beans.PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
This method gets called when a bound property is changed.

Specified by:
propertyChange sample code for java.beans.PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent) definition code for java.beans.PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent) in interface PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener
Parameters:
e - A PropertyChangeEvent object describing the event source and the property that has changed.

invalidateFileCache sample code for javax.swing.plaf.basic.BasicDirectoryModel.invalidateFileCache() definition code for javax.swing.plaf.basic.BasicDirectoryModel.invalidateFileCache()

public void invalidateFileCache()
Obsolete - not used.


getDirectories sample code for javax.swing.plaf.basic.BasicDirectoryModel.getDirectories() definition code for javax.swing.plaf.basic.BasicDirectoryModel.getDirectories()

public Vector sample code for java.util.Vector definition code for java.util.Vector <File sample code for java.io.File definition code for java.io.File > getDirectories()

getFiles sample code for javax.swing.plaf.basic.BasicDirectoryModel.getFiles() definition code for javax.swing.plaf.basic.BasicDirectoryModel.getFiles()

public Vector sample code for java.util.Vector definition code for java.util.Vector <File sample code for java.io.File definition code for java.io.File > getFiles()

validateFileCache sample code for javax.swing.plaf.basic.BasicDirectoryModel.validateFileCache() definition code for javax.swing.plaf.basic.BasicDirectoryModel.validateFileCache()

public void validateFileCache()

renameFile sample code for javax.swing.plaf.basic.BasicDirectoryModel.renameFile(java.io.File, java.io.File) definition code for javax.swing.plaf.basic.BasicDirectoryModel.renameFile(java.io.File, java.io.File)

public boolean renameFile(File sample code for java.io.File definition code for java.io.File  oldFile,
                          File sample code for java.io.File definition code for java.io.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
Since:
1.4

fireContentsChanged sample code for javax.swing.plaf.basic.BasicDirectoryModel.fireContentsChanged() definition code for javax.swing.plaf.basic.BasicDirectoryModel.fireContentsChanged()

public void fireContentsChanged()

getSize sample code for javax.swing.plaf.basic.BasicDirectoryModel.getSize() definition code for javax.swing.plaf.basic.BasicDirectoryModel.getSize()

public int getSize()
Description copied from interface: ListModel sample code for javax.swing.ListModel.getSize() definition code for javax.swing.ListModel.getSize()
Returns the length of the list.

Specified by:
getSize sample code for javax.swing.ListModel.getSize() definition code for javax.swing.ListModel.getSize() in interface ListModel sample code for javax.swing.ListModel definition code for javax.swing.ListModel
Returns:
the length of the list

contains sample code for javax.swing.plaf.basic.BasicDirectoryModel.contains(java.lang.Object) definition code for javax.swing.plaf.basic.BasicDirectoryModel.contains(java.lang.Object)

public boolean contains(Object sample code for java.lang.Object definition code for java.lang.Object  o)

indexOf sample code for javax.swing.plaf.basic.BasicDirectoryModel.indexOf(java.lang.Object) definition code for javax.swing.plaf.basic.BasicDirectoryModel.indexOf(java.lang.Object)

public int indexOf(Object sample code for java.lang.Object definition code for java.lang.Object  o)

getElementAt sample code for javax.swing.plaf.basic.BasicDirectoryModel.getElementAt(int) definition code for javax.swing.plaf.basic.BasicDirectoryModel.getElementAt(int)

public Object sample code for java.lang.Object definition code for java.lang.Object  getElementAt(int index)
Description copied from interface: ListModel sample code for javax.swing.ListModel.getElementAt(int) definition code for javax.swing.ListModel.getElementAt(int)
Returns the value at the specified index.

Specified by:
getElementAt sample code for javax.swing.ListModel.getElementAt(int) definition code for javax.swing.ListModel.getElementAt(int) in interface ListModel sample code for javax.swing.ListModel definition code for javax.swing.ListModel
Parameters:
index - the requested index
Returns:
the value at index

intervalAdded sample code for javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(javax.swing.event.ListDataEvent) definition code for javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(javax.swing.event.ListDataEvent)

public void intervalAdded(ListDataEvent sample code for javax.swing.event.ListDataEvent definition code for javax.swing.event.ListDataEvent  e)
Obsolete - not used.


intervalRemoved sample code for javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(javax.swing.event.ListDataEvent) definition code for javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(javax.swing.event.ListDataEvent)

public void intervalRemoved(ListDataEvent sample code for javax.swing.event.ListDataEvent definition code for javax.swing.event.ListDataEvent  e)
Obsolete - not used.


sort sample code for javax.swing.plaf.basic.BasicDirectoryModel.sort(java.util.Vector<? extends java.io.File>) definition code for javax.swing.plaf.basic.BasicDirectoryModel.sort(java.util.Vector<? extends java.io.File>)

protected void sort(Vector sample code for java.util.Vector definition code for java.util.Vector <? extends File sample code for java.io.File definition code for java.io.File > v)

lt sample code for javax.swing.plaf.basic.BasicDirectoryModel.lt(java.io.File, java.io.File) definition code for javax.swing.plaf.basic.BasicDirectoryModel.lt(java.io.File, java.io.File)

protected boolean lt(File sample code for java.io.File definition code for java.io.File  a,
                     File sample code for java.io.File definition code for java.io.File  b)