Groovy Documentation

org.grails.plugin.vaadin.ui
[Groovy] Class GspBodyLayout

java.lang.Object
  com.vaadin.ui.AbstractComponent
      com.vaadin.ui.AbstractComponentContainer
          com.vaadin.ui.AbstractLayout
              com.vaadin.ui.CustomLayout
                  org.grails.plugin.vaadin.ui.GspBodyLayout

class GspBodyLayout
extends CustomLayout

A Vaadin CustomLayout that uses a Grails GSP body as the template.

Authors:
Francis McKenzie


Field Summary
protected Map bodyComponents

Components resulting from rendering the body

protected boolean rendered

Prevent rendering twice

 
Property Summary
Closure body

The gsp body closure - automatically set to null when evaluated

def log

boolean root

If true, indicates this Gsp is the top-level Gsp, and not a Gsp rendered inside another.

 
Constructor Summary
GspBodyLayout()

Create an empty layout

GspBodyLayout(Closure body)

Create a layout from a Gsp body

GspBodyLayout(GspBodyLayout other)

Initialises this GspLayout from the other specified layout.

 
Method Summary
void attach()

Render when attached

protected Map removeBodyComponents()

Removes the body components from this layout, because they're needed for another layout

protected void render()

Renders the gsp body.

protected void renderBody()

Initialises the superclass CustomLayout using the specified tag body as the template.

protected Map replaceBodyComponents(Map bodyComponents)

Removes the existing body components and adds the specified components in their place

void requestRender(boolean force = false)

Requests the render to take place if not yet done.

protected def requireVaadinApplication()

Helper method for situations where a Vaadin Application is required

String toString()

This component as a String - mainly useful for logging purposes.

 
Methods inherited from class CustomLayout
getComponent, getComponentCount, setMargin, setMargin, addComponent, addComponent, setStyle, removeComponent, removeComponent, getComponentIterator, paintContent, replaceComponent, getTemplateName, getTemplateContents, setTemplateName, setTemplateContents, setMargin, getMargin, changeVariables, setEnabled, setWidth, addListener, addListener, attach, removeListener, removeListener, removeAllComponents, requestRepaintAll, moveComponentsFrom, detach, setHeight, getParent, setReadOnly, isReadOnly, setParent, getData, setLocale, getDescription, paint, getListeners, isVisible, isEnabled, setVisible, getLocale, getWidth, getHeight, setIcon, getIcon, setWidth, setWidth, setDescription, getErrorMessage, setErrorHandler, getErrorHandler, addListener, addListener, addListener, addListener, getStyle, setData, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, getStyleName, setStyleName, addStyleName, removeStyleName, getCaption, setCaption, getWindow, getApplication, childRequestedRepaint, setDebugId, getDebugId, requestRepaintRequests, isImmediate, setHeight, setHeight, getWidthUnits, setWidthUnits, getHeightUnits, setHeightUnits, setSizeFull, setSizeUndefined, setImmediate, getComponentError, setComponentError, handleError, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class AbstractLayout
setMargin, setMargin, setMargin, getMargin, paintContent, changeVariables, setEnabled, setWidth, addComponent, addListener, addListener, attach, removeListener, removeListener, removeComponent, removeAllComponents, requestRepaintAll, moveComponentsFrom, detach, setHeight, getParent, setReadOnly, isReadOnly, setParent, getData, setLocale, getDescription, paint, getListeners, isVisible, isEnabled, setVisible, getLocale, getWidth, getHeight, setIcon, getIcon, setWidth, setWidth, setDescription, getErrorMessage, setErrorHandler, getErrorHandler, addListener, addListener, addListener, addListener, getStyle, setStyle, setData, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, getStyleName, setStyleName, addStyleName, removeStyleName, getCaption, setCaption, getWindow, getApplication, childRequestedRepaint, setDebugId, getDebugId, requestRepaintRequests, isImmediate, setHeight, setHeight, getWidthUnits, setWidthUnits, getHeightUnits, setHeightUnits, setSizeFull, setSizeUndefined, setImmediate, getComponentError, setComponentError, handleError, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll, getComponentIterator, replaceComponent
 

Field Detail

bodyComponents

protected Map bodyComponents
Components resulting from rendering the body


rendered

protected boolean rendered
Prevent rendering twice


 
Property Detail

body

Closure body
The gsp body closure - automatically set to null when evaluated


log

def log


root

boolean root
If true, indicates this Gsp is the top-level Gsp, and not a Gsp rendered inside another.


 
Constructor Detail

GspBodyLayout

GspBodyLayout()
Create an empty layout


GspBodyLayout

GspBodyLayout(Closure body)
Create a layout from a Gsp body


GspBodyLayout

GspBodyLayout(GspBodyLayout other)
Initialises this GspLayout from the other specified layout.

Note that this method will remove all body components from the specified layout and add them to this one instead.

Parameters:
layout - The existing layout to apply the new template to
uri - The uri of the new template Gsp to apply


 
Method Detail

attach

void attach()
Render when attached


removeBodyComponents

protected Map removeBodyComponents()
Removes the body components from this layout, because they're needed for another layout


render

protected void render()
Renders the gsp body.


renderBody

protected void renderBody()
Initialises the superclass CustomLayout using the specified tag body as the template.

Any Vaadin Components in the tag body are automatically added to this CustomLayout, in the order in which they appear.


replaceBodyComponents

protected Map replaceBodyComponents(Map bodyComponents)
Removes the existing body components and adds the specified components in their place


requestRender

void requestRender(boolean force = false)
Requests the render to take place if not yet done.

Note that rendering should only be done after the component has been attached, as the Vaadin application is required.

Parameters:
force - Force the render, even if already done


requireVaadinApplication

protected def requireVaadinApplication()
Helper method for situations where a Vaadin Application is required


toString

String toString()
This component as a String - mainly useful for logging purposes.


 

Groovy Documentation