Venice 0.751beta

nz.org.venice.help
Class HelpPage

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bynz.org.venice.help.HelpPage
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class HelpPage
extends javax.swing.tree.DefaultMutableTreeNode

This package defines a single help page that can be viewed by the HelpModule help browser. The help page is actually a node in a tree so a help page can contain child pages - creating a hierarchichal document.

Author:
Andrew Leppard
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
HelpPage()
          Create a new root help page.
HelpPage(java.lang.String name)
          Create a new help page with the given chapter name.
 
Method Summary
 HelpPage findPageByName(java.lang.String name)
          Search the document tree, starting with this node and return the first document that has the given name, or NULL if not found.
 HelpPage findPageWithLink(java.lang.String link)
          Search the document tree, starting with this node and return the first document that has the given link.
 java.lang.String getLink()
          Create the text that a HTML link would have if it pointed to us.
 java.lang.String getName()
          Get the name of the chapter.
 java.lang.String getText()
          Return the HTML text in this page.
static HelpPage loadIndex()
          Load the index of the help documentation.
 void setLink(java.lang.String link)
          Create a page link to this helppage
 void setName(java.lang.String name)
          Set the name of the page.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HelpPage

public HelpPage(java.lang.String name)
Create a new help page with the given chapter name. The page will display the contents of the help file in the src/nz/org/venice/help/doc/ directory which has the same name as name with a trailing "html".

Parameters:
name - the name of the chapter

HelpPage

public HelpPage()
Create a new root help page. The page will display the contents of the help file in the src/nz/org/venice/help/doc/ directory which has the same name as name with a trailing "html". No parameters for constructor to fit Java Beans interface

Method Detail

setName

public void setName(java.lang.String name)
Set the name of the page.

Parameters:
name - The name of the page

getName

public java.lang.String getName()
Get the name of the chapter.

Returns:
the chapter name

getLink

public java.lang.String getLink()
Create the text that a HTML link would have if it pointed to us. This is also the name of the file that contains the page.

Returns:
the page link

setLink

public void setLink(java.lang.String link)
Create a page link to this helppage

Parameters:
link - The name of the page linking to this page

getText

public java.lang.String getText()
Return the HTML text in this page.

Returns:
the HTML text

findPageWithLink

public HelpPage findPageWithLink(java.lang.String link)
Search the document tree, starting with this node and return the first document that has the given link. Or NULL if not found.

Parameters:
link - the page link to search for
Returns:
the page

findPageByName

public HelpPage findPageByName(java.lang.String name)
Search the document tree, starting with this node and return the first document that has the given name, or NULL if not found.

Parameters:
name - The chapter name to search
Returns:
the page found

loadIndex

public static HelpPage loadIndex()
Load the index of the help documentation. This will create a tree of HelpPages for each chapter in the document. The pages' text won't be loaded.

Returns:
the root help page

Venice 0.751beta