|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.html.tree.E4TreeNode
public class E4TreeNode
Node of a tree, holds the data. The E4TreeNode is an implementation of the related interface, it handles simple tree nodes (represented by a text). Each node can have one or more subnodes.
| Example_Tree.java |
E4TreeElement,
E4Tree,
E4ModuleTreeHandling| Field Summary | |
|---|---|
protected java.lang.Object |
m_action
|
java.util.Vector |
m_additional_elements
|
long |
m_id
|
boolean |
m_isactive
|
protected boolean |
m_isopen
|
java.lang.Object |
m_obj
|
java.util.Vector |
m_sub
|
E4Label_Intf |
m_text
|
protected static long |
ms_last_id
|
| Fields inherited from class e4s.util.E4Object |
|---|
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
E4TreeNode()
Create a node, and associate it with an automatically incremental ID. |
|
E4TreeNode(E4Label_Intf text)
Create a node, and associate it with an automatically incremental ID. |
|
E4TreeNode(int public_id)
Create a node, and associate it with a general, public id - not recommended. |
|
E4TreeNode(java.lang.String text)
Create a node, and associate it with an automatically incremental ID. |
|
| Method Summary | |
|---|---|
static java.lang.String |
_getSVNVersionString()
Get version info string from subversion. |
void |
addAdditionalElement(E4HtmlElement_Intf element)
|
E4TreeNode |
addNode()
Create and add a node to the current node. |
E4TreeNode |
addNode(E4Label_Intf label)
Create and add a node to the current node. |
void |
addNode(E4TreeNode_Intf node)
Add a node to the current node. |
E4TreeNode |
addNode(java.lang.String label)
Create and add a node to the current node. |
void |
collectScripts(E4ScriptsVec v,
E4ServletImplementation_Intf servlet)
Append the current script to the Vector, each script is identified by a name and can only appear onece in the Vector. |
void |
collectStylesForEditing(E4StylesHash vec,
E4ServletImplementation_Intf servlet)
Build a list (Vector) with style definitions used so far during display of this page. |
void |
collectTranslationsForEditing(E4TranslationsVec v,
E4ServletImplementation_Intf servlet)
|
E4TreeNode_Intf |
copy()
|
E4TreeNode |
copy(boolean copy_sub)
|
int |
countNodes()
|
java.lang.Object |
findAdditionalElement(java.lang.Class clazz)
|
static E4TreeNode_Intf |
findNode(E4CgiParams params,
E4ServletImplementation_Intf servlet)
Find the tree-node which is stored in the session of the servlet, identified by parameters E4ModuleTreeHandling._PARAM_TREE_OBJ and
E4ModuleTreeHandling._PARAM_NODE_ID. |
E4TreeNode_Intf |
findSubnode(long nodeId)
Find a subnode within a tree. |
E4TreeNode_Intf |
findSubnodeText(E4String text)
Find a subnode within a tree. |
E4TreeNode_Intf |
findSubnodeText(java.lang.String text)
Find a subnode using the text. |
java.lang.Object |
getAction()
Get the associated action. |
java.util.Enumeration |
getAdditionalElements()
|
E4Color |
getBgColor()
|
FONT |
getFONT()
|
java.lang.String |
getFormattedText(Language lang)
Get the displayed text, formatted. |
long |
getId()
Get the identification for a tree node. |
IMG |
getImage()
Get the associated image for the node, depending on the isActive() state. |
IMG |
getImage(boolean mode)
Get the associated image for the node. |
java.lang.Object |
getObj()
Get the object associated with the tree node. |
CLASS_Name |
getSTYLE()
Get the E4CSS definition for this tree node. |
java.util.Enumeration |
getSubNodes()
Get an enumeration of all direct associated sub-nodes in the next level (not recursivley deeper). |
E4TreeNode_Intf[] |
getSubNodesArray()
Get an array of all direct associated sub-nodes in the next level (not recursivley deeper). |
E4Label_Intf |
getText()
Get the displayed text. |
boolean |
hasSubnodes()
Determine, if a node has subnodes. |
boolean |
isActive()
Get the active state of a tree node. |
boolean |
isOpen()
Get the open state of a tree node. |
void |
removeAllNodes()
Removes all subnodes from this node. |
boolean |
removeNode(E4TreeNode_Intf node)
Remove a node. |
boolean |
removeNode(long nodeId)
Remove a node. |
void |
resetAction()
Reset an action associated with this node. |
void |
setAction(A_Multiple mref)
Define an action associated with this node. |
void |
setAction(E4Method mref)
Define an action associated with this node. |
void |
setActive(long lookup_node)
Sets the active state of this node to true (active) and resets all subnodes to false (inactive). |
void |
setBgColor(E4Color color)
|
void |
setFONT(FONT font)
|
void |
setId(long id)
Set's the ID of an node. |
void |
setImage(IMG image)
|
void |
setImage(IMG image0,
IMG image1)
|
void |
setObj(java.lang.Object obj)
Define an object that is stored with the tree node. |
void |
setOpen(boolean open)
Change the open status of a node. |
void |
setOpen(boolean open,
int levels)
Change the open status of a node. |
void |
setSTYLE(CLASS_Name css_class)
|
void |
setText(E4Label_Intf text)
Define the text associated and displayed with this tree node. |
void |
setText(E4String text)
Define the text associated and displayed with this tree node. |
void |
setText(java.lang.String text)
Define the text associated and displayed with this tree node. |
void |
sort(Language language)
Sort the sub-elements of this node ascending. |
void |
sort(Language language,
boolean ascending)
Sort the sub-elements of this node. |
java.lang.String |
toString()
|
| Methods inherited from class e4s.util.E4Object |
|---|
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.util.Vector m_sub
protected java.lang.Object m_action
public E4Label_Intf m_text
public java.lang.Object m_obj
public long m_id
protected static long ms_last_id
protected boolean m_isopen
public boolean m_isactive
public java.util.Vector m_additional_elements
| Constructor Detail |
|---|
public E4TreeNode()
E4TreeNode(int),
getId()public E4TreeNode(java.lang.String text)
E4TreeNode(int),
E4TreeNode(),
setText(String)public E4TreeNode(E4Label_Intf text)
E4TreeNode(int),
E4TreeNode(),
setText(String)public E4TreeNode(int public_id)
public_id - the id associated with.E4TreeNode(),
getId()| Method Detail |
|---|
public static E4TreeNode_Intf findNode(E4CgiParams params,
E4ServletImplementation_Intf servlet)
throws java.lang.Exception
E4ModuleTreeHandling._PARAM_TREE_OBJ and
E4ModuleTreeHandling._PARAM_NODE_ID.
Throws an exception if parameters are missing, or the tree-element or the tree-node cannot be found.
params - the parameters, must contain at least E4ModuleTreeHandling._PARAM_TREE_OBJ and
E4ModuleTreeHandling._PARAM_NODE_ID.
java.lang.Exceptionpublic void setId(long id)
setId in interface E4TreeNode_Intfid - the new idE4Tree.renumberNodes(),
getId()public long getId()
getId in interface E4TreeNode_Intfpublic E4Label_Intf getText()
getText in interface E4TreeNode_IntfE4TreeNode_Intf.getFormattedText(e4s.application.Language)public java.lang.String getFormattedText(Language lang)
getText() and this function.
getFormattedText in interface E4TreeNode_IntfgetText()public IMG getImage(boolean mode)
isActive() and setActive(long node_id). In the case, that
two images are defined (e.g. one for the closed inactive and another for the active node)
the parameter mode defines which image to be displayed. In the case, that only one image
is defined (regardless if the node is active or not), this image will be displayed.
getImage in interface E4TreeNode_Intfmode - false: return the first image defined, true: return the second image if defined, or
return the first image if only one is defined.
getImage()public IMG getImage()
isActive() state.
This function is equal to getImage(isActive()).
getImage in interface E4TreeNode_IntfgetImage(boolean mode)public java.util.Enumeration getSubNodes()
getSubNodesArray() instead of this function.
getSubNodes in interface E4TreeNode_IntfaddNode(String),
getSubNodesArray()public E4TreeNode_Intf[] getSubNodesArray()
getSubNodesArray in interface E4TreeNode_IntfaddNode(String),
getSubNodes()public void setAction(E4Method mref)
mref - the method (function) to be invoced when the user clicks the text of
this tree node (leaf). This only works for one frame or the actual
window.setAction(A_Multiple),
resetAction(),
E4Tree.setDefaultMethod(E4Method)public void setAction(A_Multiple mref)
mref - enables multiple frames to be updated at the same time.setAction(A_Multiple),
resetAction(),
E4Tree.setDefaultMethod(E4Method)public void resetAction()
setAction(e4s.html.E4Method),
E4Tree.setDefaultMethod(E4Method)public void setText(java.lang.String text)
text - the text for display.setObj(java.lang.Object),
getText(),
setText(E4Label_Intf)public void setText(E4Label_Intf text)
text - the text for display.setObj(java.lang.Object),
getText(),
setText(String)public void setText(E4String text)
text - the text for display.setObj(java.lang.Object),
getText()public void setObj(java.lang.Object obj)
setObj in interface E4TreeNode_Intfobj - anything that needs to be storedsetText(java.lang.String),
getObj()public java.util.Enumeration getAdditionalElements()
getAdditionalElements in interface E4TreeNode_Intfpublic void addAdditionalElement(E4HtmlElement_Intf element)
public java.lang.Object findAdditionalElement(java.lang.Class clazz)
findAdditionalElement in interface E4TreeNode_Intfpublic java.lang.Object getObj()
getObj in interface E4TreeNode_IntfgetText(),
setObj(java.lang.Object)public java.lang.Object getAction()
getAction in interface E4TreeNode_IntfsetAction(A_Multiple),
setAction(E4Method),
resetAction()
public void setImage(IMG image0,
IMG image1)
setImage in interface E4TreeNode_Intfpublic void setImage(IMG image)
setImage in interface E4TreeNode_Intfpublic void addNode(E4TreeNode_Intf node)
addNode in interface E4TreeNode_Intfnode - the subnode to add (this can be an end node - leaf - or it can
recursive have subnodes either.getSubNodes(),
findSubnode(long),
addNode(),
addNode(String)public E4TreeNode addNode()
getSubNodes(),
findSubnode(long),
addNode(E4TreeNode_Intf),
addNode(String)public E4TreeNode addNode(E4Label_Intf label)
label - label for the new created node.
getSubNodes(),
findSubnode(long),
addNode(E4TreeNode_Intf)public E4TreeNode addNode(java.lang.String label)
label - label for the new created node.
getSubNodes(),
findSubnode(long),
addNode(E4TreeNode_Intf)public boolean isOpen()
isActive() state. Note, that there can be many or all nodes in
a tree having this isOpen() state, depending on the user's choice.
See also setOpen(boolean open)
isOpen in interface E4TreeNode_IntfsetOpen(boolean),
getImage(boolean),
setImage(IMG,IMG)public void setOpen(boolean open)
setOpen in interface E4TreeNode_IntfisOpen()
public void setOpen(boolean open,
int levels)
setOpen in interface E4TreeNode_Intfopen - true sets the node open, false sets the node closedlevels - go throught sub levels, repeat levels - 1 recursive. A value of MAX_INTEGER means all.isOpen()public boolean isActive()
setActive(long node_id)
to do so. This has nothing to do with the isOpen() state.
isActive in interface E4TreeNode_IntfsetActive(long)public void setActive(long lookup_node)
getId() value, then this one node is set to true (active).
By default, tree handling is associated within module E4ModuleTreeHandling.
setActive in interface E4TreeNode_Intflookup_node - the node-ID (see getId()) to be changed to activeisActive()public E4TreeNode_Intf findSubnode(long nodeId)
findSubnode in interface E4TreeNode_IntfnodeId - the node-ID (see getId()) to be searched for
public E4TreeNode_Intf findSubnodeText(java.lang.String text)
findSubnodeText in interface E4TreeNode_Intftext - the text of a tree node
findSubnode(long),
#findSubnode(E4String)public E4TreeNode_Intf findSubnodeText(E4String text)
E4TreeNode_Intf
findSubnodeText in interface E4TreeNode_Intftext - the text of a tree node
public void removeAllNodes()
removeAllNodes in interface E4TreeNode_IntfaddNode(e4s.html.tree.E4TreeNode_Intf),
getSubNodes(),
findSubnode(long)public boolean hasSubnodes()
isOpen(), a tree can have subnodes.
Subnodes are defined as objects from (implementing-)type E4TreeNode_Intf.
Note that the declaration of sub nodes is part of the implementation, not of the interface.
hasSubnodes in interface E4TreeNode_Intfpublic java.lang.String toString()
toString in class E4Object
public void collectScripts(E4ScriptsVec v,
E4ServletImplementation_Intf servlet)
collectScripts in interface E4TreeNode_Intfv - the Vector where scripts are added.E4JavaScript
public void collectStylesForEditing(E4StylesHash vec,
E4ServletImplementation_Intf servlet)
E4StyleUsage.
collectStylesForEditing in interface E4TreeNode_Intfv - the Vector where the styles will be collected, may not be nullE4ServletImplementation_Intf.sessionCanEditStyles(),
#collectStylesForEditing( e4s.html.style.E4StylesHash, STYLE_Name, boolean)public void setBgColor(E4Color color)
public E4Color getBgColor()
getBgColor in interface E4TreeNode_Intfpublic void setFONT(FONT font)
public FONT getFONT()
getFONT in interface E4TreeNode_Intfpublic void setSTYLE(CLASS_Name css_class)
public CLASS_Name getSTYLE()
E4TreeNode_Intf
getSTYLE in interface E4TreeNode_IntfsetSTYLE(e4s.html.style.CLASS_Name)
public void collectTranslationsForEditing(E4TranslationsVec v,
E4ServletImplementation_Intf servlet)
collectTranslationsForEditing in interface E4TreeNode_Intfpublic boolean removeNode(E4TreeNode_Intf node)
removeNode in interface E4TreeNode_Intfnode - the node to be removed
removeNode(long)public boolean removeNode(long nodeId)
E4TreeNode_Intf
removeNode in interface E4TreeNode_IntfnodeId - the ID of the node
public void sort(Language language)
sort in interface E4TreeNode_Intfsort(e4s.application.Language,boolean)
public void sort(Language language,
boolean ascending)
sort in interface E4TreeNode_Intfascending - true = sort ascending, false = descendingsort( e4s.application.Language )public E4TreeNode_Intf copy()
copy in interface E4TreeNode_Intfpublic E4TreeNode copy(boolean copy_sub)
public int countNodes()
countNodes in interface E4TreeNode_Intfpublic static java.lang.String _getSVNVersionString()
E4Util.getRevisionCodeFromSVN(Class)
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||