Venice 0.7beta

org.mov.help
Class HelpPage

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.mov.help.HelpPage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, 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(java.lang.String name)
          Create a new help page with the given chapter name.
 
Method Summary
 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.
 
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/org/mov/help/doc/ directory which has the same name as name with a trailing "html".

Parameters:
name - the name of the chapter
Method Detail

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

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

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.7beta