|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectorg.grails.plugin.vaadin.gsp.GspComponentNode
class GspComponentNode
Holds a Vaadin Component and a tag body, and facilitates adding components & config nested within the tag body to this component.
Field Summary | |
---|---|
protected boolean |
isBodyEvaluated
Indicates if evaluateBody() has been run yet or not. |
Property Summary | |
---|---|
Closure |
body
The tag body that will be evaluated |
CharSequence |
bodyText
The body text that results from evaluating the tag body. |
Component |
component
The Vaadin Component to which the tag body applies |
List |
configs
The collection of config objects that is populated by nested config tags when the tag body is evaluated. |
Closure |
withBody
A closure to run against the result of evaluating the tag body |
Closure |
withConfig
A closure to run against the collection of config objects that result from evaluating the tag body. |
Constructor Summary | |
GspComponentNode(Component component, Closure body)
Creates a new node with the specified Vaadin Component and tag body. |
|
GspComponentNode(Component component, Closure body, Closure withBody)
Creates a new node with the specified Vaadin Component, tag body and closure to run against the result of evaluating the tag body. |
|
GspComponentNode(Component component, Closure body, Closure withBody, Closure withConfig)
Creates a new node with the specified Vaadin Component, tag body, and closures to run against the result of evaluating the tag body, and the collection of config objects added during evaluation of the tag body. |
Method Summary | |
---|---|
CharSequence
|
attachComponent(Component child, Map params = null)
Attaches the specified child Vaadin Component to the Vaadin Component stored in this node. |
void
|
attachConfig(GspComponentConfig componentConfig)
Adds the specified component config to the collection of component configs held by this node. |
protected CharSequence
|
evaluateBody()
Evaluates the tag body, and returns the result. |
CharSequence
|
getBodyText()
Gets the text of evaluating the tag body. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
protected boolean isBodyEvaluated
Property Detail |
---|
Closure body
CharSequence bodyText
Component component
List configs
Closure withBody
Closure withConfig
Constructor Detail |
---|
GspComponentNode(Component component, Closure body)
component
- The Vaadin Component to which components in the tag body will be addedbody
- The tag body that will be evaluated
GspComponentNode(Component component, Closure body, Closure withBody)
component
- The Vaadin Component to which components in the tag body will be addedbody
- The tag body that will be evaluatedwithBody
- The closure to run against the result of evaluating the tag body
GspComponentNode(Component component, Closure body, Closure withBody, Closure withConfig)
component
- The Vaadin Component to which components in the tag body will be addedbody
- The tag body that will be evaluatedwithBody
- The closure to run against the result of evaluating the tag bodywithConfig
- The closure to run against the collection of config objects
resulting from evaluating the tag body.
Method Detail |
---|
CharSequence attachComponent(Component child, Map params = null)
Note this node's Vaadin Component MUST be of type ComponentContainer
If this node's Vaadin Component is a CustomLayout, then calls addComponent(com.vaadin.ui.Component,java.lang.String) on the component.
Otherwise, it calls addComponent(com.vaadin.ui.Component)
Node that this method can return text, which is then used by other classes such as @{link GspAttacher} to replace the component in the parent tag's body text with some HTML. However, this class always returns null from this method. Subclasses of this class should override this method if they need to return text when adding a child component.
child
- The child Vaadin Component to add to this node's container componentparams
- The (optional) params to use when adding the child component to this node's component. Typically will contain 'location'
void attachConfig(GspComponentConfig componentConfig)
Note the componentClass of the GspComponentConfig must be the same as the class of the Component in this node, otherwise an error will be thrown.
componentConfig
- The component config to add this node
protected CharSequence evaluateBody()
CharSequence getBodyText()
Groovy Documentation