www.element4solution.com

e4s.html.tree
Class E4TreeElement

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.html.E4HtmlElementGeneral
              extended by e4s.html.E4HtmlElement
                  extended by e4s.html.tree.E4TreeElement
All Implemented Interfaces:
E4HtmlElement_Intf
Direct Known Subclasses:
E4BlockMenuElement

public class E4TreeElement
extends E4HtmlElement
implements E4HtmlElement_Intf

Display a tree within your HTML page. The E4TreeElement is somehow the anchor of a tree. A tree consists of elements (nodes) of type E4TreeNode or, more general, E4TreeNode_Intf. Each node can contain 1 or more subnodes, by this structure the whole tree can be represented. There are overridable methods in the module E4ModuleTreeHandling that will handle toggle nodes and some other functions.

Example_Tree.java

Since:
JDK 1.4
See Also:
E4Tree, E4TreeNode, E4TreeNode_Intf, E4ModuleTreeHandling

Field Summary
 
Fields inherited from class e4s.html.E4HtmlElementGeneral
m_elements, m_needed_scripts
 
Fields inherited from class e4s.html.E4HtmlObject
m_parent_e4sID
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
protected E4TreeElement()
           
  E4TreeElement(E4Tree navigation)
           
  E4TreeElement(java.lang.String persistantObjId, E4ServletImplementation_Intf servlet)
           
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void collectScripts(E4ScriptsVec v, E4ServletImplementation_Intf servlet)
          Get a vector of used scripts from all subelements.
 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)
          Build a list (Vector) with translation texts used so far during display of this page.
 E4ID E4ID()
          Get the E4ID of the object.
 E4TreeNode_Intf findSubnode(long nodeId)
           
 long getCreationTime()
          Get Creation Time for the internal tree.
 long[] getOpenNodes()
          Get an array of nodes which are open.
 java.lang.String getOpenNodesString()
          Get a list of nodes which are open.
 E4Tree getTree()
           
 void removeAllNodes()
           
 void renumberNodes()
          Renumbers the nodes, starting with 1.
 void setActive(long nodeId)
           
 void setOpenNodes(long[] nodes)
          Define which nodes are open in a tree.
 void setOpenNodes(java.lang.String nodes)
          Define which nodes are open in a tree.
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
          Create the HTML output for this element.
 java.lang.String toString()
           
 
Methods inherited from class e4s.html.E4HtmlElement
addElement, addElement, addElement, copyElements, print
 
Methods inherited from class e4s.html.E4HtmlElementGeneral
addScript, addScript, addScript, addStyleForEditing, addTranslationForEditing, buildStyleAttribute, buildStyleClassReference, collectStylesForEditing, collectStylesForEditing, collectTranslationsForEditing, createScript, createScript, debugToString, findElement, findElement, findElement, findElement, getElements, getElementsVec, getField, getId, getLastElement, getStringContent, getStyle, getSTYLE, getStyle, hasScripts, hasSTYLE, isContentClass, isE4InputField_Intf, openTag, removeAll, removeElementById, removeElements, removeElements, removeStyle, setId, setReadOnly, setStyle, setStyle, setSTYLE, setValue, Style, Style, toHtml_hidden, validate
 
Methods inherited from class e4s.html.E4HtmlObject
E4ID, set_e4sID
 
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
 
Methods inherited from interface e4s.html.E4HtmlElement_Intf
addScript, addScript, addScript, debugToString, findElement, findElement, getElements, getElementsVec, getField, getId, getStringContent, isContentClass, removeAll, removeElementById, removeElements, set_e4sID, setId, setReadOnly, setValue, toHtml_hidden, validate
 

Constructor Detail

E4TreeElement

protected E4TreeElement()

E4TreeElement

public E4TreeElement(E4Tree navigation)

E4TreeElement

public E4TreeElement(java.lang.String persistantObjId,
                     E4ServletImplementation_Intf servlet)
Method Detail

getTree

public E4Tree getTree()

getCreationTime

public long getCreationTime()
Get Creation Time for the internal tree.

Returns:
creation time in milliseconds, or -1 if no internal tree object is present

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet)
            throws java.lang.Exception
Description copied from interface: E4HtmlElement_Intf
Create the HTML output for this element. Also run throught all child elements, and call their E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) function to generate output of those objects which becomes appended. Normally, there is no need to call this function anyway, and this also might result in side effects of too-early relasing of objects in some cases. This function is called by E4ServletImplementation_Intf.write(e4s.html.E4HtmlElement) on the top level HTML element (common this is a HTML or BODY element) and branches down to all child elements.

Specified by:
toHtml in interface E4HtmlElement_Intf
Overrides:
toHtml in class E4HtmlElementGeneral
servlet - the servlet environment currently running in
Throws:
java.lang.Exception

findSubnode

public E4TreeNode_Intf findSubnode(long nodeId)

setActive

public void setActive(long nodeId)

collectScripts

public void collectScripts(E4ScriptsVec v,
                           E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Get a vector of used scripts from all subelements.

Specified by:
collectScripts in interface E4HtmlElement_Intf
Overrides:
collectScripts in class E4HtmlElementGeneral
Parameters:
v - collect the names of all scripts
servlet - the servlet context
See Also:
E4JavaScript

removeAllNodes

public void removeAllNodes()

E4ID

public E4ID E4ID()
Description copied from class: E4HtmlObject
Get the E4ID of the object. The E4ID is a unique identifier for an nested HTML element, it can be either the name of the class or any previous assigned string.

Overrides:
E4ID in class E4HtmlObject
Returns:
the E4ID
See Also:
E4HtmlObject.E4ID(String), E4HtmlObject.set_e4sID(e4s.util.E4ID)

collectTranslationsForEditing

public void collectTranslationsForEditing(E4TranslationsVec v,
                                          E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Build a list (Vector) with translation texts used so far during display of this page. Run throught all subclasses elements and collect their texts as well. Note, that a text will only be added one time. The Vector contains elements of class E4Label.

Specified by:
collectTranslationsForEditing in interface E4HtmlElement_Intf
Overrides:
collectTranslationsForEditing in class E4HtmlElementGeneral
Parameters:
v - the Vector where the styles will be collected, may not be null
servlet - the current servlet instance
See Also:
E4Label_Intf

collectStylesForEditing

public void collectStylesForEditing(E4StylesHash vec,
                                    E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Build a list (Vector) with style definitions used so far during display of this page. Run throught all subclasses elements and collect their styles as well. Note, that a style will only be added one time. The Vector contains elements of class E4StyleUsage.

Specified by:
collectStylesForEditing in interface E4HtmlElement_Intf
Overrides:
collectStylesForEditing in class E4HtmlElementGeneral
Parameters:
vec - the Vector where the styles will be collected, may not be null
servlet - the servlet context
See Also:
E4ServletImplementation_Intf.sessionCanEditStyles(), #collectStylesForEditing(e4s.html.style.E4StylesHash, STYLE_Name, boolean)

renumberNodes

public void renumberNodes()
Renumbers the nodes, starting with 1.

See Also:
setOpenNodes(java.lang.String), getOpenNodes()

setOpenNodes

public void setOpenNodes(java.lang.String nodes)
Define which nodes are open in a tree. The intention of this function is, to make a possibility to store nodes that have been opened by a user for the next login of that user.

Parameters:
nodes - an list, seperated by commas, of nodes to open, null opens no nodes. The list must contains the node id's (e4s.html.E4Tree_Intf#getId()).
See Also:
getOpenNodes(), setOpenNodes(String), renumberNodes()

setOpenNodes

public void setOpenNodes(long[] nodes)
Define which nodes are open in a tree. The intention of this function is, to make a possibility to store nodes that have been opened by a user for the next login of that user.

Parameters:
nodes - an array of nodes to open, null opens no nodes. The array must contains the node id's (e4s.html.E4Tree_Intf#getId()).
See Also:
getOpenNodes(), setOpenNodes(String), renumberNodes()

getOpenNodesString

public java.lang.String getOpenNodesString()
Get a list of nodes which are open. The intention of this function is, to make a possibility to store nodes that have been opened by a user for the next login of that user.

Returns:
a list, seperated by commas, of open nodes, or null if no nodes are open. The list contains the node id's (e4s.html.E4Tree_Intf#getId()).
See Also:
getOpenNodes(), setOpenNodes(String), renumberNodes()

getOpenNodes

public long[] getOpenNodes()
Get an array of nodes which are open. The intention of this function is, to make a possibility to store nodes that have been opened by a user for the next login of that user.

Returns:
an array of open nodes, or null if no nodes are open. The array contains the node id's (e4s.html.E4Tree_Intf#getId()).
See Also:
getOpenNodesString(), setOpenNodes(long[]), renumberNodes()

toString

public java.lang.String toString()
Overrides:
toString in class E4Object

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com