Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.view
Class ZipTreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by ch.randelshofer.gui.tree.DefaultMutableTreeModel
          extended by ch.randelshofer.view.ZipTreeModel
All Implemented Interfaces:
MutableTreeModel, java.io.Serializable, javax.swing.tree.TreeModel

public class ZipTreeModel
extends DefaultMutableTreeModel

Version:
1.1 2006-07-20 Reworked for Java 1.5.
1.0 2002-02-11 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
static class ZipTreeModel.ZipNode
           
 
Field Summary
 
Fields inherited from class ch.randelshofer.gui.tree.DefaultMutableTreeModel
childTypes, listFlavor, objectFlavor
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
ZipTreeModel()
          Creates a new instance of ZipTreeModel
 
Method Summary
 javax.activation.DataSource createDataSource(ZipTreeModel.ZipNode zipNode)
          Creates a JavaBeans Activation Framework data source for the given zip node.
 void dispose()
           
 java.util.zip.ZipFile getZipFile()
          Returns the zip file used as a data source.
 void setModel(java.io.File file)
          Sets the zip file as the data source of the tree model.
 void setModel(java.io.InputStream inputStream)
          Sets the zip input stream as the data source of the tree model.
 
Methods inherited from class ch.randelshofer.gui.tree.DefaultMutableTreeModel
createNodeAt, exportTransferable, getCreatableNodeType, getCreatableNodeTypes, getNodeActions, importTransferable, insertAllInto, insertNodeInto, isEditable, isEnabled, isImportable, isNodeAddable, isNodeEditable, isNodeRemovable, removeNode, setEditable, setEnabled, setInsertableNodeTypes, setRoot
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.randelshofer.gui.tree.MutableTreeModel
removeNodeFromParent
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
 

Constructor Detail

ZipTreeModel

public ZipTreeModel()
Creates a new instance of ZipTreeModel

Method Detail

getZipFile

public java.util.zip.ZipFile getZipFile()
Returns the zip file used as a data source. This method returns null when the model has either no data source or when the data source used is an InputStream.


setModel

public void setModel(java.io.File file)
              throws java.io.IOException
Sets the zip file as the data source of the tree model.

Throws:
java.io.IOException

setModel

public void setModel(java.io.InputStream inputStream)
              throws java.io.IOException
Sets the zip input stream as the data source of the tree model.

Throws:
java.io.IOException

dispose

public void dispose()

createDataSource

public javax.activation.DataSource createDataSource(ZipTreeModel.ZipNode zipNode)
Creates a JavaBeans Activation Framework data source for the given zip node.


Copyright 2012-02-25 Werner Randelshofer