|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echoservlet.HtmlDocument
public class 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 | |
---|---|
protected java.util.Set |
cssIncludes
|
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. |
static StaticText |
SERVICE_INIT_FRAME_SCRIPT
|
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 |
addCssInclude(java.lang.String href)
Adds a referenced css include. |
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 |
renderFastComponentUpdate(java.io.PrintWriter pw,
Connection conn,
FCRenderer updateManager,
InstancePeer instancePeer)
|
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 |
---|
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.
public static final StaticText SERVICE_INIT_FRAME_SCRIPT
protected java.util.Set cssIncludes
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 void addCssInclude(java.lang.String href)
href
- of the css filepublic 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 renderFastComponentUpdate(java.io.PrintWriter pw, Connection conn, FCRenderer updateManager, InstancePeer instancePeer)
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).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |