org.xwiki.rendering.macro.container
Class AbstractContainerMacro<P extends ContainerMacroParameters>
java.lang.Object
org.xwiki.rendering.macro.AbstractMacro<P>
org.xwiki.rendering.macro.container.AbstractContainerMacro<P>
- Type Parameters:
P - the macro parameters bean
- All Implemented Interfaces:
- Comparable<org.xwiki.rendering.macro.Macro<?>>, org.xwiki.component.phase.Initializable, org.xwiki.rendering.macro.Macro<P>
public abstract class AbstractContainerMacro<P extends ContainerMacroParameters>
- extends org.xwiki.rendering.macro.AbstractMacro<P>
Abstract container macro to hold a list groups and style them together, for example laying them out as indicated by
the styleLayout parameter. For the moment this macro handles only the layouting, and only the columns layout. When it
will be enhanced with other layout styles, it should be split in multiple classes, one to handle each. This is
abstract to allow subclasses to provide the content of the macro.
- Since:
- 3.0M1
- Version:
- $Id: 2b01f65d33aa2d397b5fa0a79969e48d7d5f3667 $
| Fields inherited from class org.xwiki.rendering.macro.AbstractMacro |
beanManager, DEFAULT_CATEGORY_CONTENT, DEFAULT_CATEGORY_DEVELOPMENT, DEFAULT_CATEGORY_FORMATTING, DEFAULT_CATEGORY_NAVIGATION |
|
Constructor Summary |
protected |
AbstractContainerMacro(String name,
String description,
org.xwiki.rendering.macro.descriptor.ContentDescriptor contentDescriptor,
Class<?> parametersBeanClass)
Builds a container macro. |
|
Method Summary |
List<org.xwiki.rendering.block.Block> |
execute(P parameters,
String content,
org.xwiki.rendering.transformation.MacroTransformationContext context)
|
protected org.xwiki.component.manager.ComponentManager |
getComponentManager()
|
protected abstract List<org.xwiki.rendering.block.Block> |
getContent(P parameters,
String content,
org.xwiki.rendering.transformation.MacroTransformationContext context)
Returns the content of this macro, as blocks, either after parsing the passed content or by other means. |
protected LayoutManager |
getLayoutManager(String layoutStyle)
|
boolean |
supportsInlineMode()
|
| Methods inherited from class org.xwiki.rendering.macro.AbstractMacro |
compareTo, getDescriptor, getPriority, initialize, setDefaultCategory, setDescriptor, setPriority |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractContainerMacro
protected AbstractContainerMacro(String name,
String description,
org.xwiki.rendering.macro.descriptor.ContentDescriptor contentDescriptor,
Class<?> parametersBeanClass)
- Builds a container macro.
- Parameters:
name - the name of the macrodescription - the description of the macrocontentDescriptor - the descriptor of the content of this macroparametersBeanClass - the type of parameters of this macro
execute
public List<org.xwiki.rendering.block.Block> execute(P parameters,
String content,
org.xwiki.rendering.transformation.MacroTransformationContext context)
throws org.xwiki.rendering.macro.MacroExecutionException
- Throws:
org.xwiki.rendering.macro.MacroExecutionException
getLayoutManager
protected LayoutManager getLayoutManager(String layoutStyle)
- Parameters:
layoutStyle - the style passed to the container component
- Returns:
- the layout manager to do the layouting according to the specified layout style
getContent
protected abstract List<org.xwiki.rendering.block.Block> getContent(P parameters,
String content,
org.xwiki.rendering.transformation.MacroTransformationContext context)
throws org.xwiki.rendering.macro.MacroExecutionException
- Returns the content of this macro, as blocks, either after parsing the passed
content or by other means.
- Parameters:
parameters - the parameters of this macrocontent - the content of the macrocontext - the macro transformation context
- Returns:
- a list of blocks representing the content of this macro, as blocks
- Throws:
org.xwiki.rendering.macro.MacroExecutionException - in case anything wrong happens during parsing the content
getComponentManager
protected org.xwiki.component.manager.ComponentManager getComponentManager()
- Returns:
- the componentManager
supportsInlineMode
public boolean supportsInlineMode()
Copyright © 2004-2012 XWiki. All Rights Reserved.