|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echoservlet.HtmlDocument
A representation of an HTML document. This class functions as the root node for the tree of HTMLElements that make up a renderable document.
Field Summary | |
private Element |
body
|
private Connection |
conn
|
private boolean |
cursorOnNewLine
|
private static java.lang.String |
DOCTYPE_HTML401_TRANS
A document header for an HTML 4.01 Transitional document. |
static int |
EVENT_INITIALIZE
A script event type for "initialization" tasks. |
static int |
EVENT_ONLOAD
A script event type for "onload" tasks. |
static int |
EVENT_ONUNLOAD
A script event type for "onunload" tasks. |
private Element |
head
|
private java.util.List |
initializationEvents
|
private static Element |
META_GENERATOR
The generator meta tag. |
private int |
nextId
|
private java.util.List |
onloadEvents
|
private java.util.List |
onunloadEvents
|
private java.util.List |
rootScripts
|
private java.util.Set |
scriptIncludes
|
private static Service |
SERVICE_INIT_FRAME_SCRIPT
|
private java.util.Map |
styles
|
private int |
xScrollBarPosition
|
private int |
yScrollBarPosition
|
Constructor Summary | |
protected |
HtmlDocument(Connection conn,
Element body)
Creates a new instance rendered through the specified connection and containing body as its root content element. |
Method Summary | |
void |
addScript(java.lang.String script)
Adds a line of JavaScript that will be invoked as the document is rendered. |
void |
addScript(java.lang.String script,
int eventType)
Adds a line of JavaScript that will be invoked when an event occurs. |
void |
addScriptInclude(Service service)
Adds a referenced JavaScript include. |
java.lang.String |
addStyle(ComponentStyle componentStyle)
Adds a component style to the document. |
static HtmlDocument |
create(Connection conn)
Creates a normal document (not a frameset). |
static HtmlDocument |
createFrameSet(Connection conn)
Creates a frameset document. |
Element |
getBodyElement()
Returns the "body" element of the document. |
Element |
getHeadElement()
Returns the <head> element of the document. |
boolean |
isCursorOnNewLine()
Returns the if the browser's "rendering cursor" is at the beginning of a new line. |
void |
render(java.io.PrintWriter pw)
Renders the entire document to the specified PrintWriter. |
void |
setCursorOnNewLine(boolean cursorOnNewLine)
Sets whether the browser's rendering cursor is on a new line. |
void |
setScrollBarPositions(int x,
int y)
Sets the intial scroll bar positions of the document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String DOCTYPE_HTML401_TRANS
private static final Element META_GENERATOR
public static final int EVENT_INITIALIZE
eventName
parameter
of the addScript
method. A script added with
this event type will be executed once its document's frame's
parents have executed their initialization scripts.
public static final int EVENT_ONLOAD
eventName
parameter
of the addScript
method. A script added with
this event type will be executed once its document's frame's
child frames have executed their onload scripts.
public static final int EVENT_ONUNLOAD
evetName
parameter
of the addScript
method. A script added with
this event type will be executed when a document is removed
from service, such as in the event that its content is changed
or its window is closed or reloaded.
private static final Service SERVICE_INIT_FRAME_SCRIPT
private Element body
private Element head
private java.util.Set scriptIncludes
private java.util.List initializationEvents
private java.util.List onloadEvents
private java.util.List onunloadEvents
private java.util.Map styles
private Connection conn
private boolean cursorOnNewLine
private java.util.List rootScripts
private int xScrollBarPosition
private int yScrollBarPosition
private int nextId
Constructor Detail |
protected HtmlDocument(Connection conn, Element body)
body
as its root content element.
conn
- The connection for which this document is being put into
service.body
- The element that will be used as the root content
element of this document (a <body> or <frame>
element).Method Detail |
public static HtmlDocument create(Connection conn)
conn
- The connection to which the document will be
rendered.
public static HtmlDocument createFrameSet(Connection conn)
conn
- The connection to which the document will be
rendered.
public void addScript(java.lang.String script)
script
- A line of JavaScript code.public void addScript(java.lang.String script, int eventType)
script
- A line of JavaScript code.eventType
- The name of the event, one of the following values:
EVENT_INITIALIZE
execute the script when all frames have loaded.EVENT_ONLOAD
execute the script when all child frames have loaded.EVENT_ONUNLOAD
execute the script when the frame unloads.public void addScriptInclude(Service service)
service
- The service that renders the JavaScript include.public java.lang.String addStyle(ComponentStyle componentStyle)
componentStyle
- The component style to add to the document.
public Element getBodyElement()
public Element getHeadElement()
public boolean isCursorOnNewLine()
public void render(java.io.PrintWriter pw)
pw
- A PrintWriter to render the document to.public void setCursorOnNewLine(boolean cursorOnNewLine)
cursorOnNewLine
- True if the browser's rendering cursor
is on a new line.isCursorOnNewLine()
public void setScrollBarPositions(int x, int y)
x
- The initial horizontal scroll bar position (0 is the default).y
- The initial vertical scroll bar position (0 is the default).
|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |