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 Object
implements Renderer

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

Version:
$Revision: 44899 $ ($Author: dlipp $)
Author:
Philipp Bracher

Constructor Summary
TemplatedRenderer()
          Uses the controls class name to construct the template name
TemplatedRenderer(String templateName)
           
 
Method Summary
 String getMessage(String key)
          Get the message from the renderer.
 Messages getMessages()
          Get the messages used for the rendering.
 String getTemplateName()
           
protected  String getTemplateName(Control control)
           
 String render(Control control)
          Render the using the template.
 void setTemplateName(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(String templateName)
Parameters:
templateName -
Method Detail

render

public 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 String getMessage(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 String getTemplateName(Control control)
Returns:

getTemplateName

public String getTemplateName()
Returns:
Returns the templateName.

setTemplateName

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


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