public class TreeNodeWriter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TreeNodeWriter.Node
A single tree node.
|
static interface |
TreeNodeWriter.NodeFormatter
Formats the label of a given tree node, e.g.
|
Modifier and Type | Field and Description |
---|---|
static TreeNodeWriter.NodeFormatter |
FORMAT_ADMINTREE
Format the node using the default style for the admin backend trees.
|
static TreeNodeWriter.NodeFormatter |
FORMAT_CONTENTTREE |
static TreeNodeWriter.NodeFormatter |
FORMAT_PLAIN
Plain node formatter.
|
Constructor and Description |
---|
TreeNodeWriter(com.flexive.war.JsonWriter out,
RelativeUriMapper uriMapper,
TreeNodeWriter.NodeFormatter formatter)
Create a new TreeNodeWriter using an existing JsonWriter.
|
TreeNodeWriter(java.io.Writer out,
RelativeUriMapper uriMapper,
TreeNodeWriter.NodeFormatter formatter)
Create a new TreeNodeWriter for the given output writer.
|
Modifier and Type | Method and Description |
---|---|
void |
closeChildren()
Close the child nodes array previously created with
startChildren() . |
void |
closeNode()
Close a node previously opened with
startNode(com.flexive.faces.javascript.tree.TreeNodeWriter.Node) . |
void |
finishResponse()
Closes the tree structure.
|
void |
startChildren()
Prepare the current node (created with
startNode(com.flexive.faces.javascript.tree.TreeNodeWriter.Node)
for appending of nested child nodes. |
void |
startNode(TreeNodeWriter.Node node)
Start a new node without closing it.
|
void |
writeNode(TreeNodeWriter.Node node)
Render a leaf node.
|
public static final TreeNodeWriter.NodeFormatter FORMAT_PLAIN
public static final TreeNodeWriter.NodeFormatter FORMAT_ADMINTREE
public static final TreeNodeWriter.NodeFormatter FORMAT_CONTENTTREE
public TreeNodeWriter(com.flexive.war.JsonWriter out, RelativeUriMapper uriMapper, TreeNodeWriter.NodeFormatter formatter) throws java.io.IOException
out
- the JsonWriter instance to be useduriMapper
- URI Mapper to useformatter
- the default formatter to be usedjava.io.IOException
- if the output could not be writtenpublic TreeNodeWriter(java.io.Writer out, RelativeUriMapper uriMapper, TreeNodeWriter.NodeFormatter formatter) throws java.io.IOException
out
- an output writer.uriMapper
- URI Mapper to useformatter
- the default node formatter to be usedjava.io.IOException
- if the output could not be writtenpublic void finishResponse() throws java.io.IOException
java.io.IOException
- if the output could not be writtenpublic void startNode(TreeNodeWriter.Node node) throws java.io.IOException
closeNode()
.node
- the node to be writtenjava.io.IOException
- if the output could not be writtenpublic void closeNode() throws java.io.IOException
startNode(com.flexive.faces.javascript.tree.TreeNodeWriter.Node)
.java.io.IOException
- if the output could not be writtenpublic void writeNode(TreeNodeWriter.Node node) throws java.io.IOException
node
- the node to be renderedjava.io.IOException
- if the output could not be writtenpublic void startChildren() throws java.io.IOException
startNode(com.flexive.faces.javascript.tree.TreeNodeWriter.Node)
for appending of nested child nodes.java.io.IOException
- if the output could not be writtenpublic void closeChildren() throws java.io.IOException
startChildren()
.java.io.IOException
- if the output could not be written