to.etc.domui.dom.html
Class Page

java.lang.Object
  extended by to.etc.domui.dom.html.Page
All Implemented Interfaces:
IQContextContainer

public final class Page
extends java.lang.Object
implements IQContextContainer

This is the main owner of all nodes; this represents all that is needed for a page to render. All nodes that are (indirectly) attached to the page directly connect here. The page maintains a full ident map to all components currently reachable on the page. In addition the page assigns IDs to nodes that have no ID (or a duplicate ID).

Author:
Frits Jalvingh Created on Aug 18, 2007

Constructor Summary
Page(UrlPage pageContent)
           
 
Method Summary
 void addHeaderContributor(HeaderContributor hc, int order)
          Call from within the onHeaderContributor call on a node to register any header contributors needed by a node.
 void appendJS(java.lang.CharSequence sq)
          Add a Javascript statement (MUST be a valid, semicolon-terminated statement or statement list) to execute on return to the browser (once).
 void clearPopIn()
          Remove any pending pop-in.
protected  void copyIdMap()
          Called by all methods that change this tree.
 NodeBase findNodeByID(java.lang.String id)
           
 java.util.List<HeaderContributorEntry> getAddedContributors()
           
 DomApplication getApplication()
           
 java.util.Map<java.lang.String,NodeBase> getBeforeMap()
           
 UrlPage getBody()
          Return the BODY component for this page.
 ConversationContext getConversation()
           
<T> T
getData(java.lang.Class<T> clz)
           
 NodeBase getFocusComponent()
          Return the component that currently has a focus request.
 java.util.List<HeaderContributorEntry> getHeaderContributorList()
           
 int getPageExceptionCount()
           
 PageParameters getPageParameters()
           
 int getPageTag()
           
 NodeContainer getPopIn()
           
 NodeBase getTheCurrentControl()
          This tries to locate the control that the "theCurrentNode" is associated with.
 NodeBase getTheCurrentNode()
           
 void internalAddContributors(java.util.List<HeaderContributorEntry> full)
           
 void internalClearDeltaFully()
           
 void internalContributorsRendered()
           
 void internalDeltaBuild()
          This handles the BUILD phase for the DELTA build.
 void internalFullBuild()
          This handles the BUILD phase for a FULL page render.
 java.lang.StringBuilder internalGetAppendedJS()
           
 ConversationContext internalGetConversation()
           
 QDataContextFactory internalGetDataContextFactory()
           
 QDataContext internalGetSharedContext()
           
 void internalInitialize(PageParameters pp, ConversationContext cc)
          Assign required data to the page.
 java.util.Map<java.lang.String,NodeBase> internalNodeMap()
           
 void internalSetDataContextFactory(QDataContextFactory s)
           
 void internalSetSharedContext(QDataContext c)
           
 void internalShelve()
          Call all onShelve() handlers on all attached components.
 void internalUnshelve()
          Call all unshelve handlers on all attached components.
 boolean isAllowVectorGraphics()
           
 boolean isDestroyed()
           
 boolean isFullRenderCompleted()
           
 boolean isRenderAsXHTML()
           
 boolean isShelved()
           
 void openWindow(java.lang.Class<? extends UrlPage> clz, PageParameters pp, WindowParameters wp)
          Deprecated. 
 void openWindow(java.lang.String windowURL, WindowParameters wp)
          Deprecated. 
 void setAllowVectorGraphics(boolean allowVectorGraphics)
           
<T> void
setData(T inst)
           
 void setFocusComponent(NodeBase focusComponent)
           
 void setFullRenderCompleted(boolean fullRenderCompleted)
           
 void setPageExceptionCount(int pageExceptionCount)
           
 void setPopIn(NodeContainer pin)
          This sets a new pop-in.
 void setRenderAsXHTML(boolean renderAsXHTML)
           
 void setTheCurrentNode(NodeBase b)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Page

public Page(UrlPage pageContent)
     throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

internalInitialize

public final void internalInitialize(PageParameters pp,
                                     ConversationContext cc)
Assign required data to the page.

Parameters:
pp -
cc -

setTheCurrentNode

public void setTheCurrentNode(NodeBase b)

getTheCurrentNode

public NodeBase getTheCurrentNode()

getTheCurrentControl

public NodeBase getTheCurrentControl()
This tries to locate the control that the "theCurrentNode" is associated with. If no control can be found it returns the node verbatim.

Returns:

internalNodeMap

public java.util.Map<java.lang.String,NodeBase> internalNodeMap()

getApplication

public DomApplication getApplication()

getPageParameters

public PageParameters getPageParameters()

getPageTag

public final int getPageTag()

findNodeByID

public NodeBase findNodeByID(java.lang.String id)

copyIdMap

protected final void copyIdMap()
Called by all methods that change this tree. As soon as this gets called it checks to see if a before-image is present. If not then it gets created so that the structure before the changes is maintained.


getBeforeMap

public final java.util.Map<java.lang.String,NodeBase> getBeforeMap()

internalClearDeltaFully

public void internalClearDeltaFully()

addHeaderContributor

public final void addHeaderContributor(HeaderContributor hc,
                                       int order)
Call from within the onHeaderContributor call on a node to register any header contributors needed by a node.

Parameters:
hc -

internalAddContributors

public void internalAddContributors(java.util.List<HeaderContributorEntry> full)

getHeaderContributorList

public java.util.List<HeaderContributorEntry> getHeaderContributorList()

getAddedContributors

public java.util.List<HeaderContributorEntry> getAddedContributors()

internalContributorsRendered

public void internalContributorsRendered()

getBody

public UrlPage getBody()
Return the BODY component for this page.

Returns:

setData

public <T> void setData(T inst)

getData

public <T> T getData(java.lang.Class<T> clz)

internalFullBuild

public void internalFullBuild()
                       throws java.lang.Exception
This handles the BUILD phase for a FULL page render.

Throws:
java.lang.Exception

internalDeltaBuild

public void internalDeltaBuild()
                        throws java.lang.Exception
This handles the BUILD phase for the DELTA build. It walks only the nodes that are marked as changed initially and does not descend subtrees that are unchanged.

Throws:
java.lang.Exception

appendJS

public void appendJS(java.lang.CharSequence sq)
Add a Javascript statement (MUST be a valid, semicolon-terminated statement or statement list) to execute on return to the browser (once).


internalGetAppendedJS

public java.lang.StringBuilder internalGetAppendedJS()

openWindow

@Deprecated
public void openWindow(@Nonnull
                                  java.lang.String windowURL,
                                  @Nullable
                                  WindowParameters wp)
Deprecated. 

DEPRECATED: Should use DomUtil.createOpenWindowJS(String, WindowParameters). Force the browser to open a new window with a user-specified URL. The new window does NOT inherit any DomUI session data, of course, and has no WindowSession. After creation the window cannot be manipulated by DomUI code.

Parameters:
windowURL - The url to open. If this is a relative path it will get the webapp context appended to it.
wp -

openWindow

@Deprecated
public void openWindow(@Nonnull
                                  java.lang.Class<? extends UrlPage> clz,
                                  @Nullable
                                  PageParameters pp,
                                  @Nullable
                                  WindowParameters wp)
Deprecated. 

DEPRECATED: Should use DomUtil.createOpenWindowJS(Class, PageParameters, WindowParameters). Open a DomUI page in a separate browser popup window. This window will create it's own WindowSession. FIXME URGENT This code needs to CREATE the window session BEFORE referring to it!!!!

Parameters:
clz -
pp -
wp -

getFocusComponent

public NodeBase getFocusComponent()
Return the component that currently has a focus request.

Returns:

setFocusComponent

public void setFocusComponent(NodeBase focusComponent)

getConversation

public ConversationContext getConversation()

internalGetConversation

public ConversationContext internalGetConversation()

getPageExceptionCount

public int getPageExceptionCount()

setPageExceptionCount

public void setPageExceptionCount(int pageExceptionCount)

isFullRenderCompleted

public boolean isFullRenderCompleted()

setFullRenderCompleted

public void setFullRenderCompleted(boolean fullRenderCompleted)

internalShelve

public void internalShelve()
                    throws java.lang.Exception
Call all onShelve() handlers on all attached components.

Throws:
java.lang.Exception

internalUnshelve

public void internalUnshelve()
                      throws java.lang.Exception
Call all unshelve handlers on all attached components.

Throws:
java.lang.Exception

isShelved

public boolean isShelved()

setPopIn

public void setPopIn(NodeContainer pin)
This sets a new pop-in. This does NOT add the popin to the tree, that must be done manually.

Parameters:
pin -

clearPopIn

public void clearPopIn()
Remove any pending pop-in.


getPopIn

public NodeContainer getPopIn()

toString

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

isDestroyed

public boolean isDestroyed()

internalGetSharedContext

public QDataContext internalGetSharedContext()
Specified by:
internalGetSharedContext in interface IQContextContainer

internalSetSharedContext

public void internalSetSharedContext(QDataContext c)
Specified by:
internalSetSharedContext in interface IQContextContainer
See Also:
IQContextContainer.internalSetSharedContext(to.etc.webapp.query.QDataContext)

internalGetDataContextFactory

public QDataContextFactory internalGetDataContextFactory()
Specified by:
internalGetDataContextFactory in interface IQContextContainer

internalSetDataContextFactory

public void internalSetDataContextFactory(QDataContextFactory s)
Specified by:
internalSetDataContextFactory in interface IQContextContainer

isAllowVectorGraphics

public boolean isAllowVectorGraphics()

setAllowVectorGraphics

public void setAllowVectorGraphics(boolean allowVectorGraphics)

isRenderAsXHTML

public boolean isRenderAsXHTML()

setRenderAsXHTML

public void setRenderAsXHTML(boolean renderAsXHTML)