net.sourceforge.helpgui.page
Class Page

java.lang.Object
  extended by net.sourceforge.helpgui.page.Page
All Implemented Interfaces:
javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class Page
extends java.lang.Object
implements javax.swing.tree.MutableTreeNode

Class where the date are showed

Author:
Alexandre THOMAS

Field Summary
protected  boolean home
          If this page is home
protected  PageList pages
          subpages list
protected  Page parentPage
          Page this page is a child of
protected  PageRoot rootPage
          project this page belong to
protected  java.lang.Object userObject
          User object
 
Constructor Summary
Page(java.lang.String text, java.lang.String image, java.lang.String target, boolean home, Page parent)
          Constructor
Page(java.lang.String text, java.lang.String image, java.lang.String target, boolean home, PageRoot root)
          Constructor
Page(java.lang.String text, java.lang.String image, java.lang.String target, java.lang.String key, boolean home, Page parent)
          Constructor
Page(java.lang.String text, java.lang.String image, java.lang.String target, java.lang.String key, boolean home, PageRoot root)
          Constructor
 
Method Summary
protected  void addSubPage(Page page)
          Adds a sub page to this page.
 java.util.Enumeration children()
          Returns the children of the receiver as an Enumeration.
 boolean equals(Page page)
          Return true is the page is the same.
 boolean getAllowsChildren()
          Returns true if the receiver allows children.
 javax.swing.tree.TreeNode getChildAt(int iChildIndex)
          Returns the child TreeNode at index childIndex.
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 boolean getHome()
          Convert the Page into String.
 java.lang.String getImage()
          Return the icon name for this page.
 int getIndex(javax.swing.tree.TreeNode node)
          Returns the index of node in the receivers children.
 java.lang.String getKey()
          Returns the key associated with this page, or null if none exists
 javax.swing.tree.TreeNode getParent()
          Returns the parent TreeNode of the receiver.
 javax.swing.tree.TreePath getPath()
          Return the path of the Page on the Tree
 java.lang.String getTarget()
          Return the target of the page (the HTML URI).
 java.lang.String getText()
          Return the Title of the Page.
 void insert(javax.swing.tree.MutableTreeNode child, int index)
          Adds child to the receiver at index.
 boolean isLeaf()
          Returns true if the receiver is a leaf.
 void remove(int index)
          Removes the child at index from the receiver.
 void remove(javax.swing.tree.MutableTreeNode node)
          Removes node from the receiver.
 void removeFromParent()
          Removes the receiver from its parent.
 void setParent(javax.swing.tree.MutableTreeNode newParent)
          Sets the parent of the receiver to newParent.
 void setUserObject(java.lang.Object object)
          Resets the user object of the receiver to object.
 java.lang.String toString()
          Convert the Page into String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pages

protected PageList pages
subpages list


rootPage

protected PageRoot rootPage
project this page belong to


parentPage

protected Page parentPage
Page this page is a child of


userObject

protected java.lang.Object userObject
User object


home

protected boolean home
If this page is home

Constructor Detail

Page

public Page(java.lang.String text,
            java.lang.String image,
            java.lang.String target,
            boolean home,
            Page parent)
Constructor


Page

public Page(java.lang.String text,
            java.lang.String image,
            java.lang.String target,
            boolean home,
            PageRoot root)
Constructor


Page

public Page(java.lang.String text,
            java.lang.String image,
            java.lang.String target,
            java.lang.String key,
            boolean home,
            Page parent)
Constructor


Page

public Page(java.lang.String text,
            java.lang.String image,
            java.lang.String target,
            java.lang.String key,
            boolean home,
            PageRoot root)
Constructor

Method Detail

equals

public boolean equals(Page page)
Return true is the page is the same.


getText

public java.lang.String getText()
Return the Title of the Page.


getImage

public java.lang.String getImage()
Return the icon name for this page.


getTarget

public java.lang.String getTarget()
Return the target of the page (the HTML URI).


toString

public java.lang.String toString()
Convert the Page into String.

Overrides:
toString in class java.lang.Object

getKey

public java.lang.String getKey()
Returns the key associated with this page, or null if none exists

Returns:
the String representing the key associated with this page, or null if none is specified

getHome

public boolean getHome()
Convert the Page into String.


insert

public void insert(javax.swing.tree.MutableTreeNode child,
                   int index)
Adds child to the receiver at index.

Specified by:
insert in interface javax.swing.tree.MutableTreeNode

remove

public void remove(int index)
Removes the child at index from the receiver.

Specified by:
remove in interface javax.swing.tree.MutableTreeNode

remove

public void remove(javax.swing.tree.MutableTreeNode node)
Removes node from the receiver.

Specified by:
remove in interface javax.swing.tree.MutableTreeNode

removeFromParent

public void removeFromParent()
Removes the receiver from its parent.

Specified by:
removeFromParent in interface javax.swing.tree.MutableTreeNode

setParent

public void setParent(javax.swing.tree.MutableTreeNode newParent)
Sets the parent of the receiver to newParent.

Specified by:
setParent in interface javax.swing.tree.MutableTreeNode

setUserObject

public void setUserObject(java.lang.Object object)
Resets the user object of the receiver to object.

Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int iChildIndex)
Returns the child TreeNode at index childIndex.

Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.

Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Returns the parent TreeNode of the receiver.

Specified by:
getParent in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Returns the index of node in the receivers children.

Specified by:
getIndex in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children.

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

children

public java.util.Enumeration children()
Returns the children of the receiver as an Enumeration.

Specified by:
children in interface javax.swing.tree.TreeNode

getPath

public javax.swing.tree.TreePath getPath()
Return the path of the Page on the Tree


addSubPage

protected void addSubPage(Page page)
Adds a sub page to this page. This function is for internal use only. A subpage "A" is added automatically to a page "B" when "A"'s constructor is called given "B" as parameter.