www.element4solution.com

e4s.html
Class E4HtmlContent

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.html.E4HtmlElementGeneral
              extended by e4s.html.E4HtmlContent
All Implemented Interfaces:
E4HtmlElement_Intf

public class E4HtmlContent
extends E4HtmlElementGeneral
implements E4HtmlElement_Intf

Base content of HTML elements, not defined or structured in HTML tags, just pure text. Some elements may contain other tags, mixed with text. E.g. a >TABLE< tag may only contain tags, no text. But a <TD> tag may contain both.

Since:
JDK 1.4
See Also:
E4HtmlElement, E4HtmlContent

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
E4HtmlContent()
           
 
Method Summary
static java.lang.String _getSVNVersionString()
           
 void addElement(E4HtmlElement_Intf dummy)
          -- do not call this function, an error will result --.
 void append(java.lang.String s)
          Append a String.
 java.lang.String debugToString(int n)
          Output for debugging reasons.
 java.lang.String getStringContent()
          Get the pure string content of the elements and sub elements, without any tag information.
 boolean isContentClass()
          Returns true.
 void removeAll()
          Destroys the StringBuffer
 void toHtml_Hidden(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
           
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
          Content of the object as HTML output.
 
Methods inherited from class e4s.html.E4HtmlElementGeneral
addScript, addScript, addScript, addStyleForEditing, addTranslationForEditing, buildStyleAttribute, buildStyleClassReference, collectScripts, collectStylesForEditing, collectStylesForEditing, collectStylesForEditing, collectTranslationsForEditing, collectTranslationsForEditing, createScript, createScript, findElement, findElement, findElement, findElement, getElements, getElementsVec, getField, getId, getLastElement, getStyle, getSTYLE, getStyle, hasScripts, hasSTYLE, isE4InputField_Intf, openTag, removeElementById, removeElements, removeElements, removeStyle, setId, setReadOnly, setStyle, setStyle, setSTYLE, setValue, Style, Style, toHtml_hidden, validate
 
Methods inherited from class e4s.html.E4HtmlObject
E4ID, 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, toString, 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, collectScripts, collectStylesForEditing, collectTranslationsForEditing, findElement, findElement, getElements, getElementsVec, getField, getId, removeElementById, removeElements, set_e4sID, setId, setReadOnly, setValue, toHtml_hidden, validate
 

Constructor Detail

E4HtmlContent

public E4HtmlContent()
Method Detail

append

public void append(java.lang.String s)
Append a String. Appends a String to the internal StringBuffer object which collects all the content temporary unless the E4ServletImplementation_Intf.write(E4HtmlElement) function is called with toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) as parameter.

Parameters:
s - the string to append

addElement

public void addElement(E4HtmlElement_Intf dummy)
                throws java.lang.Throwable
-- do not call this function, an error will result --. This function is for compatibility reasons only, but it should never be called. The reason is, that this object cannot have any subnodes.

Parameters:
dummy - will be ignored and result in an error anyway
Throws:
java.lang.Throwable

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet)
Content of the object as HTML output. The internal StringBuffer is returned (see {link append(String s)}). This function is used by the other recursive toHtml() calls when the element vector is completley collected to build the HTML content.

Specified by:
toHtml in interface E4HtmlElement_Intf
Overrides:
toHtml in class E4HtmlElementGeneral
servlet - the servlet environment currently running in

toHtml_Hidden

public void toHtml_Hidden(E4StringBufferHtml buf,
                          E4ServletImplementation_Intf servlet)

getStringContent

public java.lang.String getStringContent()
Description copied from interface: E4HtmlElement_Intf
Get the pure string content of the elements and sub elements, without any tag information.

Specified by:
getStringContent in interface E4HtmlElement_Intf
Overrides:
getStringContent in class E4HtmlElementGeneral
Returns:
the pure string content or null if none

removeAll

public void removeAll()
Destroys the StringBuffer

Specified by:
removeAll in interface E4HtmlElement_Intf
Overrides:
removeAll in class E4HtmlElementGeneral

debugToString

public java.lang.String debugToString(int n)
Output for debugging reasons. General: returns a tree-like formatted display of the elements vector including recursivley all sub elements. This special case: has no subnodes (elements), the String "+--content" followed by the length of the internal StringBuffer content is returned

Specified by:
debugToString in interface E4HtmlElement_Intf
Overrides:
debugToString in class E4HtmlElementGeneral
Parameters:
n - the level (start with 0 when called external)
Returns:
the structured String with at the end of each line

isContentClass

public boolean isContentClass()
Returns true. This function returns false normally, except for this, the collecting class, E4HtmlContent which is a special case. It is detected, if it is the end of the elements. If not, such a class is added, othervise only a string is appended. This avoids excessive creation of objects.

Specified by:
isContentClass in interface E4HtmlElement_Intf
Overrides:
isContentClass in class E4HtmlElementGeneral
Returns:
always true

_getSVNVersionString

public static java.lang.String _getSVNVersionString()

www.element4solution.com