|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.javatest.util.HelpTree
public class HelpTree
A class that provides a tree of information nodes that can be selectively printed, suitable for simple command line help.
| Nested Class Summary | |
|---|---|
static class |
HelpTree.Node
A node within a HelpTree. |
class |
HelpTree.Selection
A selection of nodes within a HelpTree. |
| Constructor Summary | |
|---|---|
HelpTree()
Create an empty HelpTree object. |
|
HelpTree(HelpTree.Node[] nodes)
Create a HelpTree object containing a given set of nodes. |
|
| Method Summary | |
|---|---|
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. |
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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HelpTree()
public HelpTree(HelpTree.Node[] nodes)
nodes - the contents of the HelpTree| Method Detail |
|---|
public 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 for
public HelpTree.Selection findAll(java.lang.String[] words)
words - the words to be searched for
public HelpTree.Selection findAny(java.lang.String[] words)
words - the words to be searched for
public 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.WrapWriter
public 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 written
java.io.IOException - if the is a problem writing the
nodes.WrapWriter
public 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.WrapWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||