Class AbstractTreeDocument
java.lang.Object
com.pnfsoftware.jeb.util.events.EventSource
com.pnfsoftware.jeb.core.output.tree.impl.AbstractTreeDocument
- All Implemented Interfaces:
IGenericDocument,ITreeDocument,IEventSource
- Direct Known Subclasses:
StaticTreeDocument
An adapter for non-table trees. This class can be extended to serve as a base class for table
trees as well, by overriding the
getColumnLabels() method
The addressing system implemented in this adapter is trivial: it is a string representation of
INodeCoordinates.
Example: coordinates: (0,10,4) -> address: "0,10,4"
Clients may also override dispose().
-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.util.events.EventSource
onEventCallCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddressToCoordinates(String address) Convert a node address to node coordinates.coordinatesToAddress(INodeCoordinates coordinates) Convert node coordinates to an address understandable by the tree document and potentially the unit representing the document.coordinatesToAddress(INodeCoordinates coordinates, Function<List<INode>, String> f) Helper method to build address from coordinatesvoiddispose()The default implementation does nothing.Provide column labels for table trees.intGet the ideal expansion level of the tree.The default implementation returns null.Methods inherited from class com.pnfsoftware.jeb.util.events.EventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, relay, removeListener, setParentSourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSourceMethods inherited from interface com.pnfsoftware.jeb.core.output.IGenericDocument
getUnitMethods inherited from interface com.pnfsoftware.jeb.core.output.tree.ITreeDocument
getReferencedAddress, getRoots
-
Constructor Details
-
AbstractTreeDocument
public AbstractTreeDocument()
-
-
Method Details
-
dispose
public void dispose()The default implementation does nothing.- Specified by:
disposein interfaceIGenericDocument
-
getPropertyManager
The default implementation returns null.- Specified by:
getPropertyManagerin interfaceIGenericDocument- Returns:
- a PM, null if none
-
getColumnLabels
Description copied from interface:ITreeDocumentProvide column labels for table trees. A regular tree should return null.- Specified by:
getColumnLabelsin interfaceITreeDocument- Returns:
- the column labels, in practice at least two elements
-
getInitialExpansionLevel
public int getInitialExpansionLevel()Description copied from interface:ITreeDocumentGet the ideal expansion level of the tree. Graphical clients should use this method when doing the initial rendering of a tree document.- Specified by:
getInitialExpansionLevelin interfaceITreeDocument- Returns:
- the initial expansion level. Special values are: 0 to signify "expand nothing"; -1 to signify "expand all".
-
coordinatesToAddress
Description copied from interface:ITreeDocumentConvert node coordinates to an address understandable by the tree document and potentially the unit representing the document.Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.
- Specified by:
coordinatesToAddressin interfaceITreeDocument- Parameters:
coordinates- the node coordinates- Returns:
- the address, null on error
-
addressToCoordinates
Description copied from interface:ITreeDocumentConvert a node address to node coordinates.Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.
- Specified by:
addressToCoordinatesin interfaceITreeDocument- Parameters:
address- the input address- Returns:
- the coordinates, null on error
-
coordinatesToAddress
Helper method to build address from coordinates- Parameters:
coordinates-INodeCoordinatesf- function- argument: list of
INoderepresenting the INode path- result: String address
- argument: list of
- Returns:
-