public class HelpTree
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HelpTree.Node
A node within a HelpTree.
|
class |
HelpTree.Selection
A selection of nodes within a HelpTree.
|
| Constructor and Description |
|---|
HelpTree()
Create an empty HelpTree object.
|
HelpTree(HelpTree.Node[] nodes)
Create a HelpTree object containing a given set of nodes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(HelpTree.Node node)
Add a node to a help tree.
|
HelpTree.Selection |
find(java.lang.String[] words)
Get a selection representing the nodes that match the given words.
|
HelpTree.Selection |
findAll(java.lang.String[] words)
Get a selection representing the nodes that match all of the given words.
|
HelpTree.Selection |
findAny(java.lang.String[] words)
Get a selection representing the nodes that each match
at least one of the given words.
|
int |
getDescriptionIndent()
Get the indentation used to adjust the left margin when writing
the description of a node.
|
java.util.Comparator<HelpTree.Node> |
getNodeComparator()
Returns current comparator used in
find methods
method |
int |
getNodeIndent()
Get the indentation used to adjust the left margin when writing
the child nodes for a node.
|
void |
setDescriptionIndent(int n)
Set the indentation used to adjust the left margin when writing
the description of a node.
|
void |
setNodeComparator(java.util.Comparator<HelpTree.Node> comparator)
Sets the comparator which will be used in
find methods
method |
void |
setNodeIndent(int n)
Set the indentation used to adjust the left margin when writing
the child nodes for a node.
|
void |
write(java.io.Writer out)
Write out all the nodes in this HelpTree.
|
void |
write(java.io.Writer out,
HelpTree.Selection s)
Write out selected nodes in this HelpTree.
|
void |
writeSummary(java.io.Writer out)
Write out a summary of all the nodes in this HelpTree.
|
public HelpTree()
public HelpTree(HelpTree.Node[] nodes)
nodes - the contents of the HelpTreepublic void addNode(HelpTree.Node node)
node - the node to be added to the treepublic int getNodeIndent()
setNodeIndent(int)public void setNodeIndent(int n)
n - the indentation used to adjust the left margin when writing
the child nodes for a nodegetNodeIndent()public int getDescriptionIndent()
setDescriptionIndent(int)public void setDescriptionIndent(int n)
n - the indentation used to adjust the left margin when writing
the description of a nodegetDescriptionIndent()public HelpTree.Selection find(java.lang.String[] words)
words - the words to be searched forpublic HelpTree.Selection findAll(java.lang.String[] words)
words - the words to be searched forpublic HelpTree.Selection findAny(java.lang.String[] words)
words - the words to be searched forpublic void write(java.io.Writer out)
throws java.io.IOException
out - the writer to which to write the nodes.
If out is a com.sun.javatest.util.WrapWriter, it will be
used directly, otherwise a WrapWriter will be created
that will write to the given writer.java.io.IOException - if the is a problem writing the
nodes.WrapWriterpublic void write(java.io.Writer out,
HelpTree.Selection s)
throws java.io.IOException
out - the writer to which to write the nodes.
If out is a com.sun.javatest.util.WrapWriter, it will be
used directly, otherwise a WrapWriter will be created
that will write to the given writer.s - a Selection object containing the nodes to be writtenjava.io.IOException - if the is a problem writing the
nodes.WrapWriterpublic void writeSummary(java.io.Writer out)
throws java.io.IOException
out - the writer to which to write the nodes.
If out is a com.sun.javatest.util.WrapWriter, it will be
used directly, otherwise a WrapWriter will be created
that will write to the given writer.java.io.IOException - if the is a problem writing the
nodes.WrapWriterpublic void setNodeComparator(java.util.Comparator<HelpTree.Node> comparator)
find methods
methodcomparator - Comparator to setpublic java.util.Comparator<HelpTree.Node> getNodeComparator()
find methods
methodCopyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.