org.xwiki.rendering.internal.macro.dashboard
Class EditableGadgetRenderer

java.lang.Object
  extended by org.xwiki.rendering.internal.macro.dashboard.DefaultGadgetRenderer
      extended by org.xwiki.rendering.internal.macro.dashboard.EditableGadgetRenderer
All Implemented Interfaces:
GadgetRenderer

@Component(value="edit")
public class EditableGadgetRenderer
extends DefaultGadgetRenderer

Editable gadget renderer, that renders the gadget as in view mode, but with additional metadata that allows editing the gadget parameters.

Since:
3.0rc1
Version:
$Id$

Field Summary
protected  org.xwiki.rendering.renderer.BlockRenderer gadgetContentRenderer
          The macro content renderer, to render the macro as annotated XHTML to be editable.
protected static java.lang.String METADATA
          The identifier of the metadata block for this dashboard (class parameter of the generated XDOM container that holds the rest of the metadata).
 
Fields inherited from class org.xwiki.rendering.internal.macro.dashboard.DefaultGadgetRenderer
CLASS, ID
 
Constructor Summary
EditableGadgetRenderer()
           
 
Method Summary
 java.util.List<Block> decorateGadget(Gadget gadget)
          Decorates the passed gadget and renders it as a list of XDOM blocks.
protected  Block getGadgetEditMetadata(Gadget gadget)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METADATA

protected static final java.lang.String METADATA
The identifier of the metadata block for this dashboard (class parameter of the generated XDOM container that holds the rest of the metadata).

See Also:
Constant Field Values

gadgetContentRenderer

@Requirement(value="annotatedxhtml/1.0")
protected org.xwiki.rendering.renderer.BlockRenderer gadgetContentRenderer
The macro content renderer, to render the macro as annotated XHTML to be editable.

Constructor Detail

EditableGadgetRenderer

public EditableGadgetRenderer()
Method Detail

getGadgetEditMetadata

protected Block getGadgetEditMetadata(Gadget gadget)
Parameters:
gadget - the gadget to decorate
Returns:
the block containing the metadata that will allow clients to edit this gadget

decorateGadget

public java.util.List<Block> decorateGadget(Gadget gadget)
Decorates the passed gadget and renders it as a list of XDOM blocks.

Specified by:
decorateGadget in interface GadgetRenderer
Overrides:
decorateGadget in class DefaultGadgetRenderer
Parameters:
gadget - the gadget to render
Returns:
the list of blocks resulted from rendering the passed gadget and decorating it (with containers, etc)
See Also:
#decorateGadget(org.xwiki.rendering.macro.dashboard.Gadget)


Copyright © 2004-2011 XWiki. All Rights Reserved.