com.wewebu.ow.server.ui
Class OwTreeView.OwTreeViewNode

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwTreeView.OwTreeViewNode
Direct Known Subclasses:
OwObjectTreeViewEXTJS.OwTreeViewNodeJS
Enclosing class:
OwTreeView

public class OwTreeView.OwTreeViewNode
extends Object


Field Summary
protected  List m_childs
          child nodes
protected  String m_displaypath
           
protected  boolean m_fChildsCreated
          flag indicating if the children have been created already
protected  boolean m_fCollapsed
          flag indicating if node is collapsed, initially true
protected  boolean m_fFirstSibling
          flag indicating if this is the first sibling
protected  boolean m_fLastSibling
          flag indicating if this is the last sibling
protected  boolean m_fPlusMinusIcon
          flag indicating if a plus minus icon should be drawn, initially true
protected  Object m_obj
          object that is managed by the node
protected  OwTreeView.OwTreeViewNode m_parent
          parent object to the node
protected  String m_path
          path to the node
protected  String m_strCloseFolderURL
          URL to the close folder icon
protected  String m_strOpenFolderURL
          URL to the open folder icon
protected  OwTreeView m_view
          reference to the underlying view
 
Constructor Summary
OwTreeView.OwTreeViewNode(OwTreeView treeView_p, Object obj_p)
          construct a tree node
 
Method Summary
protected  void createChilds()
          create the children or this node
 boolean equals(Object otherObject_p)
           
 void expand()
           
 String getCloseIconURL()
          get a URL to the close icon
 String getDisplayHTML()
          Returns HTML code to be used to display a node.
If you override this method, you have to make sure that the HTML code is properly encoded!
 String getDisplayName()
          Returns the text to be displayed as the name of the node.
This text will be properly encoded before used.
 String getDisplayPath()
          get the displayed path
 String getID()
          get a unique string ID for the node
 String getLabelEventURL()
          get the event URL when clicked on a label
 String getName()
          get the name for an object, default returns getName
 Object getObject()
           
 Object getObjectParent()
          get the object of the parent node
 String getOpenIconURL()
          get a URL to the open icon
 OwTreeView.OwTreeViewNode getParent()
          get the parent node
 OwTreeView.OwTreeViewNode getParentFromDepth(int iLevel_p)
          gets the Parent repeatedly for iLevel_p counts
 String getPath()
          get the path
 String getPlusMinusIconEventURL()
          get the event URL when clicked on a plus / minus icon
 int hashCode()
           
 boolean hasPlusMinusIcon()
          check of node has subnodes
 boolean isCollapsed()
           
 boolean isEnabled()
          check if node is enabled, i.e.
 boolean isFirstSibling()
          Returns the flag indicating if this is the first sibling
 boolean isLastSibling()
          Returns the flag indicating if this is the last sibling
protected  OwTreeView.OwTreeViewNode navigate(StringTokenizer pathtokens_p)
          navigate to the sub node by the given path
protected  void refresh()
          force node to reload its child nodes
 void toggleExpand()
          expand / collapse the node
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_view

protected OwTreeView m_view
reference to the underlying view


m_fLastSibling

protected boolean m_fLastSibling
flag indicating if this is the last sibling


m_fFirstSibling

protected boolean m_fFirstSibling
flag indicating if this is the first sibling


m_path

protected String m_path
path to the node


m_displaypath

protected String m_displaypath

m_fChildsCreated

protected boolean m_fChildsCreated
flag indicating if the children have been created already


m_fPlusMinusIcon

protected boolean m_fPlusMinusIcon
flag indicating if a plus minus icon should be drawn, initially true


m_strOpenFolderURL

protected String m_strOpenFolderURL
URL to the open folder icon


m_strCloseFolderURL

protected String m_strCloseFolderURL
URL to the close folder icon


m_parent

protected OwTreeView.OwTreeViewNode m_parent
parent object to the node


m_fCollapsed

protected boolean m_fCollapsed
flag indicating if node is collapsed, initially true


m_childs

protected List m_childs
child nodes


m_obj

protected Object m_obj
object that is managed by the node

Constructor Detail

OwTreeView.OwTreeViewNode

public OwTreeView.OwTreeViewNode(OwTreeView treeView_p,
                                 Object obj_p)
construct a tree node

Parameters:
treeView_p - OwTreeView reference
obj_p - Object which is managed by the tree view
Method Detail

getObject

public Object getObject()
Returns:
Object which is managed by the tree view

getLabelEventURL

public String getLabelEventURL()
get the event URL when clicked on a label


getPlusMinusIconEventURL

public String getPlusMinusIconEventURL()
get the event URL when clicked on a plus / minus icon


getParentFromDepth

public OwTreeView.OwTreeViewNode getParentFromDepth(int iLevel_p)
gets the Parent repeatedly for iLevel_p counts

Parameters:
iLevel_p -
Returns:
iLevel_p = 0 this node, iLevel_p = 1 parent of this node, iLevel_p = 2 parent of parent of this node, ...

getParent

public OwTreeView.OwTreeViewNode getParent()
get the parent node

Returns:
OwTreeViewNode

getObjectParent

public Object getObjectParent()
get the object of the parent node

Returns:
the object of the parent node or null if none is available

getID

public String getID()
get a unique string ID for the node


getCloseIconURL

public String getCloseIconURL()
                       throws Exception
get a URL to the close icon

Returns:
String URL to the close icon
Throws:
Exception

getOpenIconURL

public String getOpenIconURL()
                      throws Exception
get a URL to the open icon

Returns:
String URL to the close icon
Throws:
Exception

getDisplayName

public String getDisplayName()
                      throws Exception
Returns the text to be displayed as the name of the node.
This text will be properly encoded before used.

Returns:
the text to be displayed as the name of the node.
Throws:
Exception

getDisplayHTML

public String getDisplayHTML()
                      throws Exception
Returns HTML code to be used to display a node.
If you override this method, you have to make sure that the HTML code is properly encoded!

Returns:
HTML code to be used to display a node
Throws:
Exception
Since:
2.5.3.0

isEnabled

public boolean isEnabled()
                  throws Exception
check if node is enabled, i.e. can open the folder

Returns:
true = enabled, false = disabled
Throws:
Exception

getName

public String getName()
               throws Exception
get the name for an object, default returns getName

Returns:
the display name for an object
Throws:
Exception

hasPlusMinusIcon

public boolean hasPlusMinusIcon()
                         throws Exception
check of node has subnodes

Returns:
true if plus minus icon should be displayed to open subnodes
Throws:
Exception

toggleExpand

public void toggleExpand()
                  throws Exception
expand / collapse the node

Throws:
Exception

expand

public void expand()
            throws Exception
Throws:
Exception

createChilds

protected void createChilds()
                     throws Exception
create the children or this node

Throws:
Exception

refresh

protected void refresh()
                throws Exception
force node to reload its child nodes

Throws:
Exception

navigate

protected OwTreeView.OwTreeViewNode navigate(StringTokenizer pathtokens_p)
                                      throws Exception
navigate to the sub node by the given path

Parameters:
pathtokens_p - StringTokenizer tokenized path
Returns:
OwTreeViewNode the navigated node
Throws:
Exception

equals

public boolean equals(Object otherObject_p)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getDisplayPath

public String getDisplayPath()
get the displayed path


getPath

public String getPath()
get the path


isCollapsed

public boolean isCollapsed()
Returns:
trueif node is collapsed , false otherwise

isLastSibling

public boolean isLastSibling()
Returns the flag indicating if this is the last sibling

Returns:
the flag indicating if this is the last sibling
Since:
2.5.3.0

isFirstSibling

public boolean isFirstSibling()
Returns the flag indicating if this is the first sibling

Returns:
the flag indicating if this is the first sibling
Since:
2.5.3.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.