info.magnolia.cms.gui.controlx.impl
Class TemplatedRenderer

java.lang.Object
  extended by info.magnolia.cms.gui.controlx.impl.TemplatedRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
ListControlRenderer

public class TemplatedRenderer
extends java.lang.Object
implements Renderer

Used the classname by default to get the template to render.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Philipp Bracher

Constructor Summary
TemplatedRenderer()
          Uses the controls class name to construct the template name
TemplatedRenderer(java.lang.String templateName)
           
 
Method Summary
 java.lang.String getMessage(java.lang.String key)
          Get the message from the renderer.
 Messages getMessages()
          Get the messages used for the rendering.
 java.lang.String getTemplateName()
           
protected  java.lang.String getTemplateName(Control control)
           
 java.lang.String render(Control control)
          Render the using the template.
 void setTemplateName(java.lang.String templateName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplatedRenderer

public TemplatedRenderer()
Uses the controls class name to construct the template name


TemplatedRenderer

public TemplatedRenderer(java.lang.String templateName)
Parameters:
templateName -
Method Detail

render

public java.lang.String render(Control control)
Render the using the template. The control is passed under the name 'this' and the renderer class is passed under the name 'renderer'

Specified by:
render in interface Renderer

getMessage

public java.lang.String getMessage(java.lang.String key)
Get the message from the renderer. Uses getMessages().

Parameters:
key -
Returns:
the string found, or the key if not found

getMessages

public Messages getMessages()
Get the messages used for the rendering. By default the standard messages are returned.

Returns:
the messages

getTemplateName

protected java.lang.String getTemplateName(Control control)
Returns:

getTemplateName

public java.lang.String getTemplateName()
Returns:
Returns the templateName.

setTemplateName

public void setTemplateName(java.lang.String templateName)
Parameters:
templateName - The templateName to set.


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.