to.etc.domui.dom.html
Class NodeBase

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
All Implemented Interfaces:
IModelBinding, INodeErrorDelegate
Direct Known Subclasses:
BR, Checkbox, FileInput, Img, Input, LiteralXhtml, NodeContainer, RadioButton, TextNode

public abstract class NodeBase
extends CssBase
implements INodeErrorDelegate, IModelBinding

Base node for all non-container html dom nodes.

Delta tree calculation

We need to be able to calculate a delta tree very fast. The speed of the delta calculation is a large factor in response time and server CPU utilization. Delta calculation works by defining a strict way in which the DOM is manipulated (conceptual):

  1. We define the BEFORE state of the tree. This is the state of the tree when a new request ENTERS the server. The before state is conceptually maintained by copying all "parent" pointers and all "child" lists of all nodes (in a special way). This means that a single node has both a "current" state (the normal parent and childList properties) and an "old" state (the state of it's parent and children properties before code that possibly changes the tree starts).
  2. In the 'application-phase' we start executing code that can change the tree. We run all input handlers, then we handle all events. When all code ran we have the AFTER state of the tree, contained in the actual tree properties (parent and childList). In addition, every change in the structure has left a mark on every container node. This mark "percolates" upwards, so we can quickly see which container(s) have changes. If the tree is unchanged we see it immediately because the root node has no "childHasUpdates" indication.
  3. We now have a valid BEFORE and a valid AFTER image. By comparing the nodes in OLD and ACTUAL we can easily determine tree ownership everywhere.

Special problems

For the mechanism to work properly it is very important that the BEFORE state is proper. This means that the BEFORE state may NOT be changed when, during the application-phase, nodes are removed and possibly re-added to the tree. For this event it is important that even when the node is added and removed the BEFORE state is kept as ATTACHED; it may not change as the result of the moves executed in between.

When nodes are removed from the tree and in a different request/response cycle are added again we must ensure that any state from the previous delta run leaks to the new delta run; if this happens it usually results in a "Hell Freezeth over" exception. Because nodes removed from the tree in a phase are not reachable anymore it is hard to clear this state after the delta run.

Author:
Frits Jalvingh Created on Aug 18, 2007

Constructor Summary
protected NodeBase(java.lang.String tag)
           
 
Method Summary
 java.lang.String $(java.lang.String key, java.lang.Object... param)
          Translate the key passed into a message string, using the component's message bundle.
 boolean acceptRequestParameter(java.lang.String[] values)
           
 void addCssClass(java.lang.String name)
          Add the class passed as another CSS class to the "class" attribute.
 UIMessage addGlobalMessage(UIMessage m)
          This adds a message to the "global" message list.
protected  void afterCreateContent()
           
 void appendAfterMe(NodeBase item)
          Add the node passed immediately after this node in the tree.
 void appendBeforeMe(NodeBase item)
          Add the node passed immediately before this node in the tree.
 void appendCreateJS(java.lang.CharSequence js)
          This adds a Javascript segment to be executed when the component is (re)constructed.
 void appendJavascript(java.lang.CharSequence js)
          This adds a Javascript segment to be executed one time, as soon as the current request returns.
 void build()
          Not normally called from outside, this forces the node to call createContent if needed (if unbuilt).
protected  void changed()
          Called on stylesheet changes.
 void clearFocusRequested()
          Reset the "request focus" flag.
 void clearGlobalMessage()
           
 void clearGlobalMessage(java.lang.String code)
           
 void clearGlobalMessage(UIMessage m)
           
 void clearMessage()
          Remove this-component's "current" error message, if present.
 void componentHandleWebAction(RequestContextImpl ctx, java.lang.String action)
          Default handling for webui AJAX actions to a component.
 void createContent()
           
 IBundle findComponentBundle()
          Returns the component's message bundle stack.
 void forceRebuild()
          Force this node to be rebuilt by fully clearing all it's content (removing all children).
 java.lang.String getActualID()
          When the node is attached to a page this returns the ID assigned to it.
 IClicked<?> getClicked()
          Return the click handler for this node, or null if none is associated with it.
 IBundle getComponentBundle()
          Returns the component's message bundle stack.
 java.lang.StringBuilder getCreateJS()
           
 java.lang.String getCssClass()
          Return the full "class" (css class) attribute for this node.
 INodeErrorDelegate getErrorDelegate()
           
 java.lang.String getErrorLocation()
          When set this contains a user-understandable tekst indicating which control has the error.
 UIMessage getMessage()
           
 java.lang.String getOnClickJS()
           
 java.lang.String getOnMouseDownJS()
           
 Page getPage()
          Return the Page for this node, if attached, or null otherwise.
 NodeContainer getParent()
          Return the current actual parent of this node.
<T> T
getParent(java.lang.Class<T> clz)
          Walk the parents upwards to find the closest parent of the given class.
 NodeContainer getParent(int up)
          Find the nth upward parent of this node.
 QDataContext getSharedContext()
           
 java.lang.String getSpecialAttribute(java.lang.String name)
          Return the value for the "special" attribute with the specified name, if present.
 java.util.List<java.lang.String> getSpecialAttributeList()
          Return the list of special attributes and their value.
 java.lang.String getTag()
          Return the node's tag name (the html tag this node represents).
 java.lang.String getTestID()
          When set this causes a "testid" attribute to be rendered on the node.
 java.lang.String getTitle()
          Returns the title as set verbatim; if it was set using a tilde key this returns the key without resource bundle replacement.
 java.lang.Object getUserObject()
          Get whatever user object is set into this node as set by setUserObject(Object).
protected  void handleDrop(RequestContextImpl ctx)
          Called when a drop is done on a DropTarget node.
 boolean hasCssClass(java.lang.String cls)
          Returns T if the css class passed is present in the current cssclass.
 boolean hasError()
          Return T if this node currently has an error associated with it.
 void internalClearDelta()
           
 void internalClearDeltaFully()
           
 NodeContainer internalGetOldParent()
           
 boolean internalHasChangedAttributes()
          INTERNAL ONLY Set when this node has changed attributes.
 boolean internalNeedClickHandler()
          Mostly internal only: override when this component has a clicked handler which must not be rendered as a Javascript "onclick".
 void internalOnClicked()
          Internal, do the proper run sequence for a clicked event.
 void internalSetHasChangedAttributes()
          Internal use only.
 void internalSetHasChangedAttributes(boolean d)
          Internal only.
protected  void internalSetTag(java.lang.String tag)
          INTERNAL USE ONLY, FOR SPECIAL CASES!!!! Node tags may NEVER change once rendered to the browser.
protected  void internalShelve()
           
protected  void internalUnshelve()
           
 boolean isBuilt()
          Returns T if the node's content has been built (createContent() has been called).
 boolean isFocusRequested()
          Returns T if this control has requested the focus.
 void moveControlToModel()
          EXPERIMENTAL - DO NOT USE.
 void moveModelToControl()
          EXPERIMENTAL - DO NOT USE.
 void onAddedToPage(Page p)
           
 void onBeforeFullRender()
           
protected  void onForceRebuild()
          Called when forceRebuild is done on this node.
 void onHeaderContributors(Page page)
           
protected  void onRefresh()
           
 void onRemoveFromPage(Page p)
           
protected  void onShelve()
           
protected  void onUnshelve()
           
 void refresh()
           
 void remove()
          Disconnect this node from it's parent.
 boolean removeCssClass(java.lang.String name)
          Removes the specified CSS class.
 void renderJavascriptState(java.lang.StringBuilder sb)
          This gets called when a component is re-rendered fully because of a full page refresh.
 void replaceWith(NodeBase nw)
          Replace this node in it's parent with the node passed.
 void setClicked(IClicked<?> clicked)
          Set a click handler for this node.
 void setComponentBundle(IBundle bundle)
          Set a message bundle for this component.
 void setControlsEnabled(boolean on)
          EXPERIMENTAL - DO NOT USE.
 void setCssClass(java.lang.String cssClass)
          Set the value for the "class" (css class) attribute.
 void setErrorDelegate(INodeErrorDelegate errorDelegate)
           
 void setErrorLocation(java.lang.String errorLocation)
          When set this contains a user-understandable tekst indicating which control has the error.
 void setFocus()
          Claim the focus for this component.
 UIMessage setMessage(UIMessage msg)
          This sets a message (an error, warning or info message) on this control.
 void setOnClickJS(java.lang.String onClickJS)
           
 void setOnMouseDownJS(java.lang.String onMouseDownJS)
           
 void setSpecialAttribute(java.lang.String name, java.lang.String value)
          This is a generic method to add tag add attributes to a tag.
 void setTestID(java.lang.String testID)
          Set an ID that can be used for finding this node in the HTML using test software.
 void setTitle(java.lang.String title)
          Set the title attribute, using tilde replacement.
 void setUserObject(java.lang.Object userObject)
          Set some user object into this node.
 void stretchHeight()
          EXPERIMENTAL Method can be used to stretch height of element to take all available free space in parent container.
 java.lang.String toString()
           
abstract  void visit(INodeVisitor v)
          This must visit the appropriate method in the node visitor.
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeBase

protected NodeBase(@Nonnull
                   java.lang.String tag)
Method Detail

visit

public abstract void visit(INodeVisitor v)
                    throws java.lang.Exception
This must visit the appropriate method in the node visitor. It should NOT recurse it's children.

Parameters:
v -
Throws:
java.lang.Exception

internalHasChangedAttributes

public final boolean internalHasChangedAttributes()
INTERNAL ONLY Set when this node has changed attributes. Does not include child changes.

Returns:

internalSetHasChangedAttributes

public final void internalSetHasChangedAttributes(boolean d)
Internal only.

Parameters:
d -

internalSetHasChangedAttributes

public final void internalSetHasChangedAttributes()
Internal use only.


internalOnClicked

public void internalOnClicked()
                       throws java.lang.Exception
Internal, do the proper run sequence for a clicked event.

Throws:
java.lang.Exception

changed

protected final void changed()
Called on stylesheet changes. Clears the style cache.

Overrides:
changed in class CssBase
See Also:
CssBase.changed()

internalGetOldParent

public final NodeContainer internalGetOldParent()

internalClearDelta

public void internalClearDelta()

internalClearDeltaFully

public void internalClearDeltaFully()

getActualID

@Nonnull
public final java.lang.String getActualID()
When the node is attached to a page this returns the ID assigned to it. To call it before is an error and throws IllegalStateException.

Returns:

getTag

@Nonnull
public final java.lang.String getTag()
Return the node's tag name (the html tag this node represents).

Returns:

internalSetTag

protected final void internalSetTag(@Nonnull
                                    java.lang.String tag)
INTERNAL USE ONLY, FOR SPECIAL CASES!!!! Node tags may NEVER change once rendered to the browser.

Parameters:
tag -

getPage

@Nullable
public final Page getPage()
Return the Page for this node, if attached, or null otherwise.

Returns:

getCssClass

@Nullable
public final java.lang.String getCssClass()
Return the full "class" (css class) attribute for this node.


setCssClass

public void setCssClass(@Nullable
                        java.lang.String cssClass)
Set the value for the "class" (css class) attribute. This can be null, or one or more class names separated by space.

Parameters:
cssClass -

removeCssClass

public final boolean removeCssClass(@Nonnull
                                    java.lang.String name)
Removes the specified CSS class. This looks in the space delimited list and removes all 'words' there that match this name. Returns T if the class was actually present.

Parameters:
name -
Returns:

addCssClass

public final void addCssClass(@Nonnull
                              java.lang.String name)
Add the class passed as another CSS class to the "class" attribute. If the class already contains class names this one is added separated by space.

Parameters:
name -

hasCssClass

public final boolean hasCssClass(@Nonnull
                                 java.lang.String cls)
Returns T if the css class passed is present in the current cssclass.

Parameters:
cls -
Returns:

getParent

@Nullable
public final NodeContainer getParent()
Return the current actual parent of this node. Is null if not attached to a parent yet.

Returns:

getParent

@Nullable
public final NodeContainer getParent(int up)
Find the nth upward parent of this node. When n == 1 this is the same as getParent(): it returns the direct parent. For n == 2 this returns the parent of the parent etc. As soon as a null parent is encountered this will return null.

Parameters:
up -
Returns:

getParent

@Nullable
public final <T> T getParent(java.lang.Class<T> clz)
Walk the parents upwards to find the closest parent of the given class. The class can be a base class (it is not a literal match but an instanceof match).

Type Parameters:
T -
Parameters:
clz -
Returns:

remove

public final void remove()
Disconnect this node from it's parent. The node can be reconnected to another parent afterwards.


replaceWith

public final void replaceWith(NodeBase nw)
Replace this node in it's parent with the node passed. This node becomes unattached to the tree and can be reused. The new node takes the exact position of this node in the tree.

Parameters:
nw -

appendAfterMe

public final void appendAfterMe(@Nonnull
                                NodeBase item)
Add the node passed immediately after this node in the tree.

Parameters:
item -

appendBeforeMe

public final void appendBeforeMe(@Nonnull
                                 NodeBase item)
Add the node passed immediately before this node in the tree.

Parameters:
item -

build

public final void build()
                 throws java.lang.Exception
Not normally called from outside, this forces the node to call createContent if needed (if unbuilt). FIXME Should probably become internal.

Throws:
java.lang.Exception

forceRebuild

@OverridingMethodsMustInvokeSuper
public void forceRebuild()
Force this node to be rebuilt by fully clearing all it's content (removing all children). Use this to force a component to redraw itself fully, for instance after it's state or content changes.


isBuilt

public boolean isBuilt()
Returns T if the node's content has been built (createContent() has been called).

Returns:

setTitle

public void setTitle(java.lang.String title)
Set the title attribute, using tilde replacement. If the string starts with a ~ it is assumed to be a key into the page's resource bundle.

Parameters:
title -

getTitle

public java.lang.String getTitle()
Returns the title as set verbatim; if it was set using a tilde key this returns the key without resource bundle replacement.

Returns:

getClicked

@Nullable
public IClicked<?> getClicked()
Return the click handler for this node, or null if none is associated with it.

Returns:

setClicked

public void setClicked(@Nullable
                       IClicked<?> clicked)
Set a click handler for this node. This will be attached to the Javascript "onclick" handler for this node and will fire when the node is clicked.

Parameters:
clicked -

internalNeedClickHandler

public boolean internalNeedClickHandler()
Mostly internal only: override when this component has a clicked handler which must not be rendered as a Javascript "onclick". For instance the LookupForm returns false for this, so that it can override the "clicked" property to be called when the lookupform's SEARCH button is pressed.

Returns:

getUserObject

@Nullable
public java.lang.Object getUserObject()
Get whatever user object is set into this node as set by setUserObject(Object).

Returns:

setUserObject

public void setUserObject(@Nullable
                          java.lang.Object userObject)
Set some user object into this node.

Parameters:
userObject -

getTestID

public java.lang.String getTestID()
When set this causes a "testid" attribute to be rendered on the node. This ID can then be used for selenium tests et al.

Returns:

setTestID

public void setTestID(java.lang.String testID)
Set an ID that can be used for finding this node in the HTML using test software. The test id is rendered as a "testid" attribute.

Parameters:
testID -

getOnClickJS

public java.lang.String getOnClickJS()

setOnClickJS

public void setOnClickJS(java.lang.String onClickJS)

getOnMouseDownJS

public java.lang.String getOnMouseDownJS()

setOnMouseDownJS

public void setOnMouseDownJS(java.lang.String onMouseDownJS)

appendJavascript

public void appendJavascript(java.lang.CharSequence js)
This adds a Javascript segment to be executed one time, as soon as the current request returns. The code is rendered only once. This should only be used in "event" based code; if you need javascript to create a component you need to call appendCreateJS(CharSequence). This method can be called from all code to add a Javascript to execute on the browser. This Javascript should only reference global state or this specific component because the order of execution for multiple components is explicitly undefined.

Parameters:
js -

appendCreateJS

public void appendCreateJS(java.lang.CharSequence js)
This adds a Javascript segment to be executed when the component is (re)constructed. It gets added to the page's onload() code every time this object is constructed. It gets rendered only when the component is initially created or when the page is fully refreshed. The latter means that this string may not contain state information because this means that the running Javascript state of the component will be reset when the page is refreshed. This Javascript should only reference global state or this specific component because the order of execution for multiple components is explicitly undefined.

Parameters:
js -

getCreateJS

public java.lang.StringBuilder getCreateJS()

setSpecialAttribute

public void setSpecialAttribute(@Nonnull
                                java.lang.String name,
                                @Nullable
                                java.lang.String value)
This is a generic method to add tag add attributes to a tag. It can be used to add attributes that are not defined on the HTML class for the node, like "onblur", "testid" and the like. There are no limitations to what can be generated with it but since it is expensive it should be used little. If a given attribute is used many times it must be created as a field proper.

Parameters:
name -
value -

getSpecialAttributeList

@Nullable
public java.util.List<java.lang.String> getSpecialAttributeList()
Return the list of special attributes and their value. The even index retrieves the name, the odd index it's value. See setSpecialAttribute(String, String) for details. FIXME This should return a copy, not the actual attributes.

Returns:

getSpecialAttribute

@Nullable
public java.lang.String getSpecialAttribute(@Nonnull
                                                     java.lang.String name)
Return the value for the "special" attribute with the specified name, if present.

Parameters:
name -
Returns:

componentHandleWebAction

public void componentHandleWebAction(@Nonnull
                                     RequestContextImpl ctx,
                                     @Nonnull
                                     java.lang.String action)
                              throws java.lang.Exception
Default handling for webui AJAX actions to a component.

Parameters:
ctx -
action -
Throws:
java.lang.Exception

acceptRequestParameter

public boolean acceptRequestParameter(@Nonnull
                                      java.lang.String[] values)
                               throws java.lang.Exception
Throws:
java.lang.Exception

setErrorLocation

public void setErrorLocation(java.lang.String errorLocation)
When set this contains a user-understandable tekst indicating which control has the error. It usually contains the "label" associated with the control, and is set automatically by form builders if possible.

Parameters:
errorLocation -

getErrorLocation

public java.lang.String getErrorLocation()
When set this contains a user-understandable tekst indicating which control has the error. It usually contains the "label" associated with the control, and is set automatically by form builders if possible.

Returns:

setMessage

public UIMessage setMessage(UIMessage msg)
This sets a message (an error, warning or info message) on this control. If the control already has an error then we check if the severity of the new error is higher than the severity of the existing one; only in that case will the error be removed. To clear the error message call clearMessage().

Specified by:
setMessage in interface INodeErrorDelegate
Parameters:
mt -
code -
param -

clearMessage

public void clearMessage()
Remove this-component's "current" error message, if present.

Specified by:
clearMessage in interface INodeErrorDelegate

getMessage

public UIMessage getMessage()
Specified by:
getMessage in interface INodeErrorDelegate

hasError

public boolean hasError()
Return T if this node currently has an error associated with it.

Returns:

setErrorDelegate

public void setErrorDelegate(INodeErrorDelegate errorDelegate)

getErrorDelegate

public INodeErrorDelegate getErrorDelegate()

addGlobalMessage

public UIMessage addGlobalMessage(UIMessage m)
This adds a message to the "global" message list. The message "percolates" upwards to the first parent that acts as an error message fence. That component will be responsible for rendering the error message at an appropriate location.

Parameters:
mt -
code -
param -

clearGlobalMessage

public void clearGlobalMessage()

clearGlobalMessage

public void clearGlobalMessage(UIMessage m)

clearGlobalMessage

public void clearGlobalMessage(java.lang.String code)

setComponentBundle

public final void setComponentBundle(@Nullable
                                     IBundle bundle)
Set a message bundle for this component. This overrides any and all auto-lookup mechanism, and can only be used before the message bundle is ever used (any call to $(), findComponentBundle() and whatnot). Explicitly setting the bundle to null prevents any bundle lookup, and makes all bundle related calls fail.

Parameters:
bundle -

findComponentBundle

@Nullable
public final IBundle findComponentBundle()
Returns the component's message bundle stack. This is either explicitly set using setComponentBundle(IBundle), or the component searches for a stack of message bundles by locating [classname] and "message" bundles for itself and all it's parent classes. If no message bundles are found at all this will return null.

Returns:

getComponentBundle

@Nonnull
public final IBundle getComponentBundle()
Returns the component's message bundle stack. This is either explicitly set using setComponentBundle(IBundle), or the component searches for a stack of message bundles by locating [classname] and "message" bundles for itself and all it's parent classes. If no message bundles are found at all this throws an IllegalStateException.

Returns:

$

public java.lang.String $(java.lang.String key,
                          java.lang.Object... param)
Translate the key passed into a message string, using the component's message bundle. See setComponentBundle(IBundle) and findComponentBundle() for details on how a component find it's messages.

Parameters:
key -
param -
Returns:

internalShelve

protected void internalShelve()
                       throws java.lang.Exception
Throws:
java.lang.Exception

internalUnshelve

protected void internalUnshelve()
                         throws java.lang.Exception
Throws:
java.lang.Exception

onForceRebuild

protected void onForceRebuild()
Called when forceRebuild is done on this node.


onShelve

protected void onShelve()
                 throws java.lang.Exception
Throws:
java.lang.Exception

onUnshelve

protected void onUnshelve()
                   throws java.lang.Exception
Throws:
java.lang.Exception

onRefresh

protected void onRefresh()
                  throws java.lang.Exception
Throws:
java.lang.Exception

renderJavascriptState

public void renderJavascriptState(java.lang.StringBuilder sb)
                           throws java.lang.Exception
This gets called when a component is re-rendered fully because of a full page refresh. It should only be used for components that maintain a lot of state in Javascript on the browser. These components need to add Javascript commands to that browser to restore/initialize the state to whatever is present in the server's data store. It must do that by adding the needed Javascript to the buffer passed.

Parameters:
sb -
Throws:
java.lang.Exception

onBeforeFullRender

public void onBeforeFullRender()
                        throws java.lang.Exception
Throws:
java.lang.Exception

createContent

public void createContent()
                   throws java.lang.Exception
Throws:
java.lang.Exception

afterCreateContent

protected void afterCreateContent()
                           throws java.lang.Exception
Throws:
java.lang.Exception

onAddedToPage

public void onAddedToPage(Page p)

onRemoveFromPage

public void onRemoveFromPage(Page p)

onHeaderContributors

public void onHeaderContributors(Page page)

handleDrop

protected void handleDrop(RequestContextImpl ctx)
                   throws java.lang.Exception
Called when a drop is done on a DropTarget node. This calls the appropriate handlers on both the drop node AND the draggable that was dropped.

Parameters:
ctx -
Throws:
java.lang.Exception

moveControlToModel

public void moveControlToModel()
                        throws java.lang.Exception
EXPERIMENTAL - DO NOT USE. For non-input non-container nodes this does exactly nothing.

Specified by:
moveControlToModel in interface IModelBinding
Throws:
java.lang.Exception
See Also:
IModelBinding.moveControlToModel()

moveModelToControl

public void moveModelToControl()
                        throws java.lang.Exception
EXPERIMENTAL - DO NOT USE. For non-input non-container nodes this does exactly nothing.

Specified by:
moveModelToControl in interface IModelBinding
Throws:
java.lang.Exception
See Also:
IModelBinding.moveModelToControl()

setControlsEnabled

public void setControlsEnabled(boolean on)
EXPERIMENTAL - DO NOT USE. For non-input non-container nodes this does exactly nothing.

Specified by:
setControlsEnabled in interface IModelBinding
See Also:
IModelBinding.setControlsEnabled(boolean)

getSharedContext

public QDataContext getSharedContext()
                              throws java.lang.Exception
Returns:
Throws:
java.lang.Exception

setFocus

public void setFocus()
Claim the focus for this component. Only reasonable for input type and action components (links, buttons). For now this can only be called for components that are already attached to a page. If this is a proble I'll fix it. Only one component in a page can claim focus for itself.


isFocusRequested

public final boolean isFocusRequested()
Returns T if this control has requested the focus.

Returns:

clearFocusRequested

public final void clearFocusRequested()
Reset the "request focus" flag.


refresh

public final void refresh()
                   throws java.lang.Exception
Throws:
java.lang.Exception

stretchHeight

public void stretchHeight()
EXPERIMENTAL Method can be used to stretch height of element to take all available free space in parent container.


toString

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