BasicDirectoryModel (Java 2 Platform SE 5.0) (original) (raw)


javax.swing.plaf.basic

Class BasicDirectoryModel

java.lang.Object extended by javax.swing.AbstractListModel extended by javax.swing.plaf.basic.BasicDirectoryModel

All Implemented Interfaces:

PropertyChangeListener, Serializable, EventListener, ListModel


public class BasicDirectoryModel

extends AbstractListModel

implements PropertyChangeListener

Basic implementation of a file list.


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

BasicDirectoryModel

public BasicDirectoryModel(JFileChooser filechooser)

Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent e)

Description copied from interface: [PropertyChangeListener](../../../../java/beans/PropertyChangeListener.html#propertyChange%28java.beans.PropertyChangeEvent%29)

This method gets called when a bound property is changed.

Specified by:

[propertyChange](../../../../java/beans/PropertyChangeListener.html#propertyChange%28java.beans.PropertyChangeEvent%29) in interface [PropertyChangeListener](../../../../java/beans/PropertyChangeListener.html "interface in java.beans")

Parameters:

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


invalidateFileCache

public void invalidateFileCache()

Obsolete - not used.


getDirectories

public Vector<File> getDirectories()


getFiles

public Vector<File> getFiles()


validateFileCache

public void validateFileCache()


renameFile

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

Since:

1.4


fireContentsChanged

public void fireContentsChanged()


getSize

public int getSize()

Description copied from interface: [ListModel](../../../../javax/swing/ListModel.html#getSize%28%29)

Returns the length of the list.

Specified by:

[getSize](../../../../javax/swing/ListModel.html#getSize%28%29) in interface [ListModel](../../../../javax/swing/ListModel.html "interface in javax.swing")

Returns:

the length of the list


contains

public boolean contains(Object o)


indexOf

public int indexOf(Object o)


getElementAt

public Object getElementAt(int index)

Description copied from interface: [ListModel](../../../../javax/swing/ListModel.html#getElementAt%28int%29)

Returns the value at the specified index.

Specified by:

[getElementAt](../../../../javax/swing/ListModel.html#getElementAt%28int%29) in interface [ListModel](../../../../javax/swing/ListModel.html "interface in javax.swing")

Parameters:

index - the requested index

Returns:

the value at index


intervalAdded

public void intervalAdded(ListDataEvent e)

Obsolete - not used.


intervalRemoved

public void intervalRemoved(ListDataEvent e)

Obsolete - not used.


sort

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


lt

protected boolean lt(File a, File b)



Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.