nextapp.echoservlet
Class FCDocument

java.lang.Object
  extended by nextapp.echoservlet.HtmlDocument
      extended by nextapp.echoservlet.FCDocument
All Implemented Interfaces:
java.io.Serializable

public class FCDocument
extends HtmlDocument

See Also:
Serialized Form

Field Summary
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.
 
Fields inherited from class nextapp.echoservlet.HtmlDocument
cssIncludes, SERVICE_INIT_FRAME_SCRIPT
 
Constructor Summary
FCDocument(Connection conn, Element body, ComponentPeer peer)
          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.
 int countScriptIncludes(java.io.PrintWriter out)
           
 java.util.Set getAllComponentStyles()
           
 Element getBodyElement()
          Returns the "body" element of the document.
 Connection getConnection()
           Gets the
 Element getHeadElement()
          Returns the <head> element of the document.
 ComponentPeer getPeer()
           
 boolean isCursorOnNewLine()
          Returns the if the browser's "rendering cursor" is at the beginning of a new line.
 void renderCSSIncludes(java.io.PrintWriter out)
           
 void renderHtml(java.io.PrintWriter pw, javax.servlet.http.HttpSession session, ComponentPeer fastComponentPeer)
           
 void renderScriptIncludes(java.io.PrintWriter out)
           
 void renderScriptsInsideFastComponentSpan(java.io.PrintWriter out)
           
 void renderUpdateScript(java.io.PrintWriter out, javax.servlet.http.HttpSession session, ComponentPeer fastComponentPeer)
           
 void replaceClassAsStyle()
           
 void setConnection(Connection connection)
           Sets the
 void setCursorOnNewLine(boolean cursorOnNewLine)
          Sets whether the browser's rendering cursor is on a new line.
 void setPeer(ComponentPeer peer)
           
 void setScrollBarPositions(int x, int y)
          Sets the intial scroll bar positions of the document.
 
Methods inherited from class nextapp.echoservlet.HtmlDocument
addCssInclude, create, createFrameSet, render, renderFastComponentUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_INITIALIZE

public static final int EVENT_INITIALIZE
A script event type for "initialization" tasks. This constant is a suitable value for the 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.

See Also:
Constant Field Values

EVENT_ONLOAD

public static final int EVENT_ONLOAD
A script event type for "onload" tasks. This constant is a suitable value for the 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.

See Also:
Constant Field Values

EVENT_ONUNLOAD

public static final int EVENT_ONUNLOAD
A script event type for "onunload" tasks. This constant is a suitable value for the 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.

See Also:
Constant Field Values
Constructor Detail

FCDocument

public FCDocument(Connection conn,
                  Element body,
                  ComponentPeer peer)
Creates a new instance rendered through the specified connection and containing body as its root content element.

Parameters:
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

addScript

public void addScript(java.lang.String script)
Adds a line of JavaScript that will be invoked as the document is rendered. Such scripts may invoked before all resources are available, and thus most script calls should be added using the addScript(script, eventName) method. This method is only useful for adding global script variables to the document body.

Overrides:
addScript in class HtmlDocument
Parameters:
script - A line of JavaScript code.

addScript

public void addScript(java.lang.String script,
                      int eventType)
Adds a line of JavaScript that will be invoked when an event occurs. These lines of JavaScript will be executed in the order that they were added.

Overrides:
addScript in class HtmlDocument
Parameters:
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.

addScriptInclude

public void addScriptInclude(Service service)
Adds a referenced JavaScript include.

Overrides:
addScriptInclude in class HtmlDocument
Parameters:
service - The service that renders the JavaScript include.

addStyle

public java.lang.String addStyle(ComponentStyle componentStyle)
Adds a component style to the document. Returns the name of the style in the document.

Overrides:
addStyle in class HtmlDocument
Parameters:
componentStyle - The component style to add to the document.
Returns:
The document-specific name of the style. The document-specific name of the style is not necessarily identical to the style's name. The name of the style provided here must be used in all element "class" attributes that use the style to guarantee proper rendering.

getBodyElement

public Element getBodyElement()
Returns the "body" element of the document. This will either be a <body> element in the case of a content-holding document or a <frameset> element in the case of a frameset document.

Overrides:
getBodyElement in class HtmlDocument
Returns:
The "body" tag of the document.

getHeadElement

public Element getHeadElement()
Returns the <head> element of the document.

Overrides:
getHeadElement in class HtmlDocument
Returns:
The <head> element of the document.

isCursorOnNewLine

public boolean isCursorOnNewLine()
Returns the if the browser's "rendering cursor" is at the beginning of a new line. This is used to inform a component that is being rendered whether the last component will automatically move the browser's rendering cursor to the start of a new line, as is the case after a <br> or closing </table> tag is encountered.

Overrides:
isCursorOnNewLine in class HtmlDocument
Returns:
True if the cursor is on a new line.

replaceClassAsStyle

public void replaceClassAsStyle()

renderUpdateScript

public void renderUpdateScript(java.io.PrintWriter out,
                               javax.servlet.http.HttpSession session,
                               ComponentPeer fastComponentPeer)

renderHtml

public void renderHtml(java.io.PrintWriter pw,
                       javax.servlet.http.HttpSession session,
                       ComponentPeer fastComponentPeer)

renderScriptsInsideFastComponentSpan

public void renderScriptsInsideFastComponentSpan(java.io.PrintWriter out)

renderScriptIncludes

public void renderScriptIncludes(java.io.PrintWriter out)

countScriptIncludes

public int countScriptIncludes(java.io.PrintWriter out)

renderCSSIncludes

public void renderCSSIncludes(java.io.PrintWriter out)

setCursorOnNewLine

public void setCursorOnNewLine(boolean cursorOnNewLine)
Sets whether the browser's rendering cursor is on a new line.

Overrides:
setCursorOnNewLine in class HtmlDocument
Parameters:
cursorOnNewLine - True if the browser's rendering cursor is on a new line.
See Also:
isCursorOnNewLine()

setScrollBarPositions

public void setScrollBarPositions(int x,
                                  int y)
Sets the intial scroll bar positions of the document.

Overrides:
setScrollBarPositions in class HtmlDocument
Parameters:
x - The initial horizontal scroll bar position (0 is the default).
y - The initial vertical scroll bar position (0 is the default).

getAllComponentStyles

public java.util.Set getAllComponentStyles()

getPeer

public ComponentPeer getPeer()

setPeer

public void setPeer(ComponentPeer peer)

getConnection

public Connection getConnection()

Gets the


setConnection

public void setConnection(Connection connection)

Sets the