| java.lang.Object vqwiki.lex.MakeTableOfContents
MakeTableOfContents | public class MakeTableOfContents (Code) | | Experimental class. This class may be used in two ways:
The static addTableOfContents(String) method may be called to automatically
adds a table of contents on the right side of an article. This method
works with all lexers, because it parses the HTML for headers. However it
doesn't care where it is. So if you have a header on the TopArea / LeftMenu /
BottomArea, it will also add a TOC there...
The static addTableOfContents(MakeTableOfContents, StringBuffer) method
may be called to insert a pre-built MakeTableOfContents object into an
article. This method requires that the parser has added all table of
contents headings to the object and included a TOC_INSERT_TAG at the point
where the table of contents should be inserted. It is a bit more flexible
but requires more preperatory work.
author: studer |
Inner Class :class TableOfContentsEntry | |
Method Summary | |
public void | addEntry(String name, String text, int level) Add a new table of contents entry.
Parameters: name - The name of the entry, to be used in the anchor tag name. Parameters: text - The text to display for the table of contents entry. Parameters: level - The level of the entry. | public static String | addTableOfContents(String text) Adds TOC at the beginning as a table on the right side of the page if the
page has any HTML-headers. | public static StringBuffer | addTableOfContents(MakeTableOfContents toc, StringBuffer contents) Insert an existing MakeTableOfContents object into formatted HTML
output.
Parameters: toc - A pre-built MakeTableOfContents object. Parameters: contents - The Wiki syntax, which should contain TOC_INSERT_TAG atthe point where the table of contents object is to be inserted. | public int | getStatus() Return the current table of contents status, such as "no table of contents
allowed" or "uninitialized". | public void | setStatus(int status) Set the current table of contents status, such as "no table of contents
allowed" or "uninitialized". | public int | size() Return the number of entries in this TOC object. | public String | toHTML() Return an HTML representation of this table of contents object. |
STATUS_NO_TOC | final public static int STATUS_NO_TOC(Code) | | |
STATUS_TOC_INITIALIZED | final public static int STATUS_TOC_INITIALIZED(Code) | | |
STATUS_TOC_UNINITIALIZED | final public static int STATUS_TOC_UNINITIALIZED(Code) | | |
TOC_INSERT_TAG | final public static String TOC_INSERT_TAG(Code) | | |
addEntry | public void addEntry(String name, String text, int level)(Code) | | Add a new table of contents entry.
Parameters: name - The name of the entry, to be used in the anchor tag name. Parameters: text - The text to display for the table of contents entry. Parameters: level - The level of the entry. If an entry is a sub-heading ofanother entry the value should be 2. If there is a sub-heading of thatentry then its value would be 3, and so forth. |
addTableOfContents | public static String addTableOfContents(String text)(Code) | | Adds TOC at the beginning as a table on the right side of the page if the
page has any HTML-headers.
Parameters: text - |
addTableOfContents | public static StringBuffer addTableOfContents(MakeTableOfContents toc, StringBuffer contents)(Code) | | Insert an existing MakeTableOfContents object into formatted HTML
output.
Parameters: toc - A pre-built MakeTableOfContents object. Parameters: contents - The Wiki syntax, which should contain TOC_INSERT_TAG atthe point where the table of contents object is to be inserted. The formatted content containing the table of contents. |
getStatus | public int getStatus()(Code) | | Return the current table of contents status, such as "no table of contents
allowed" or "uninitialized".
|
setStatus | public void setStatus(int status)(Code) | | Set the current table of contents status, such as "no table of contents
allowed" or "uninitialized".
|
size | public int size()(Code) | | Return the number of entries in this TOC object.
|
toHTML | public String toHTML()(Code) | | Return an HTML representation of this table of contents object.
|
|
|