ch.randelshofer.quaqua.panther.filechooser
Class SidebarListModel
java.lang.Object
javax.swing.AbstractListModel
ch.randelshofer.quaqua.panther.filechooser.SidebarListModel
- All Implemented Interfaces:
- java.io.Serializable, java.util.EventListener, javax.swing.event.TreeModelListener, javax.swing.ListModel
public class SidebarListModel
- extends javax.swing.AbstractListModel
- implements javax.swing.event.TreeModelListener
This is the list model used to display a sidebar in the PantherFileChooserUI.
The list consists of two parts: the system items and the user items.
The user items are read from the file "~/Library/Preferences/com.apple.sidebarlists.plist".
The system items is the contents of the "/Volumes" directory plus the
"/Networks" directory.
Each element of the SidebarListModel implements the interface FileInfo.
- Version:
- 3.0.3 2008-04-17 Method FileItem invoked its worker too many times.
3.0.2 2008-03-17 Method validate() fired intervalAdded event with
wrong value.
3.0.1 2007-11-02 Remove leaf nodes from system items.
3.0 2007-06-18 Resolve aliases lazily.
2.2.1 2007-01-25 Don't fill userItems with File object's that we
can't use anyway.
2.2 2006-09-23 Show "Computer" as first item in system list.
2.1 2006-05-07 Fixed sorting of "Computer" item in system list.
2.0.1 2006-02-17 Add only those defaultUserItems that exist. Added
support for Japanese Desktop directory on Windows XPJ.
2.0 2005-11-26 Rewritten to better support system items.
1.1 2005-08-26 Support for Windows added.
1.0.6 2005-07-07 Suppress error message when we aren't able to
build a sidebar because native support for the File object is not available.
1.0.5 2005-06-20 Throw an exception, if alias resolution is not supported by
class OSXFile. In this case, we are unable to create a sidebar list based on user preferences,
and we have to fall back to a predefined list.
1.0.4 2005-06-20 Don't throw an exception when we can't resolve an alias.
1.0.3 2005-06-05 Moved System.getProperty calls into QuaquaManager.
1.0.2 2004-12-26 Method read left the input stream to the sidebar
file open.
1.0.1 2004-11-28 Removed unnecessary main method.
1.0 November 4, 2004 Created.
- Author:
- Werner Randelshofer
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary |
SidebarListModel(javax.swing.JFileChooser fileChooser,
javax.swing.tree.TreePath path,
javax.swing.tree.TreeModel model)
Creates a new instance. |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SidebarListModel
public SidebarListModel(javax.swing.JFileChooser fileChooser,
javax.swing.tree.TreePath path,
javax.swing.tree.TreeModel model)
- Creates a new instance.
dispose
public void dispose()
getSize
public int getSize()
- Specified by:
getSize
in interface javax.swing.ListModel
getElementAt
public java.lang.Object getElementAt(int row)
- Specified by:
getElementAt
in interface javax.swing.ListModel
treeNodesChanged
public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
- Specified by:
treeNodesChanged
in interface javax.swing.event.TreeModelListener
treeNodesInserted
public void treeNodesInserted(javax.swing.event.TreeModelEvent e)
- Specified by:
treeNodesInserted
in interface javax.swing.event.TreeModelListener
treeNodesRemoved
public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
- Specified by:
treeNodesRemoved
in interface javax.swing.event.TreeModelListener
treeStructureChanged
public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
- Specified by:
treeStructureChanged
in interface javax.swing.event.TreeModelListener
lazyValidate
public void lazyValidate()
- Validates the model if needed.