java.lang.Objectorg.apache.poi.contrib.poibrowser.TreeReaderListener
All Implemented Interfaces:
POIFSReaderListener
Organizes document information in a tree model in order to be e.g. displayed in a Swing javax.swing.JTree . An instance of this class is created with a root tree node (MutableTreeNode ) and registered as a POIFSReaderListener with a org.apache.poi.poifs.eventfilesystem.POIFSReader . While the latter processes a POI filesystem it calls this class' #processPOIFSReaderEvent for each document it has been registered for. This method appends the document it processes at the appropriate position into the tree rooted at the above mentioned root tree node.
The root tree node should be the root tree node of a javax.swing.tree.TreeModel .
A top-level element in the tree model, i.e. an immediate child node of the root node, describes a POI filesystem as such. It is suggested to use the file's name (as seen by the operating system) but it could be any other string.
The value of a tree node is a DocumentDescriptor . Unlike a org.apache.poi.poifs.filesystem.POIFSDocument which may be as heavy as many megabytes, an instance of DocumentDescriptor is a light-weight object and contains only some meta-information about a document.
Rainer - Klute <klute@rainer-klute.de>$ - Id: TreeReaderListener.java 489730 2006-12-22 19:18:16Z bayard $2002-01-24 - | Field Summary | ||
|---|---|---|
| protected MutableTreeNode | rootNode | The tree's root node. POI filesystems get attached to this node as children. |
| protected Map | pathToNode | Maps filenames and POI document paths to their associated tree nodes. |
| protected String | filename | The name of the file this TreeReaderListener processes. It is used to identify a top-level element in the tree. Alternatively any other string can be used. It is just a label which should identify a POI filesystem. |
| Constructor: |
|---|
Creates a TreeReaderListener which should then be registered with a org.apache.poi.poifs.eventfilesystem.POIFSReader .
|
| Method from org.apache.poi.contrib.poibrowser.TreeReaderListener Summary: |
|---|
| getNrOfBytes, processPOIFSReaderEvent, setNrOfBytes |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.poi.contrib.poibrowser.TreeReaderListener Detail: |
|---|
|
A document in the POI filesystem has been opened for reading. This method retrieves properties of the document and adds them to a tree model. |
|