|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.renderer.v2.macro.BaseMacro com.atlassian.renderer.v2.macro.basic.AbstractPanelMacro
public abstract class AbstractPanelMacro
Abstract class for panel macros. Your implementation will need to provide css classes for panel container, panel header and panel body. These CSS classes will define the default look and feel. Users can override these default styles through styles specified in macro parameters.
Field Summary |
---|
Fields inherited from interface com.atlassian.renderer.v2.macro.Macro |
---|
RAW_PARAMS_KEY |
Constructor Summary | |
---|---|
AbstractPanelMacro()
|
Method Summary | |
---|---|
String |
execute(Map parameters,
String body,
RenderContext renderContext)
Execute the macro. |
protected String |
getBodyContent(Map parameters,
String body,
RenderContext renderContext)
|
RenderMode |
getBodyRenderMode()
If the macro has a body, return the mode in which the body of the macro should be rendered. |
protected abstract String |
getPanelContentCSSClass()
|
protected abstract String |
getPanelCSSClass()
|
protected abstract String |
getPanelHeaderCSSClass()
|
protected SubRenderer |
getSubRenderer()
|
protected String |
getTitle(Map parameters,
String body,
RenderContext renderContext)
|
boolean |
hasBody()
Determine if the macro is a one-shot macro, or one that takes a body. |
boolean |
isInline()
Determine if the macro is an "inline" element in the resulting HTML. |
void |
setSubRenderer(SubRenderer subRenderer)
|
protected void |
writeContent(StringBuffer buffer,
Map parameters,
String content,
String backgroundColor)
|
protected void |
writeHeader(RenderContext renderContext,
StringBuffer buffer,
String title,
String borderStyle,
String borderColor,
int borderWidth,
String titleBackgroundColor)
|
Methods inherited from class com.atlassian.renderer.v2.macro.BaseMacro |
---|
suppressMacroRenderingDuringWysiwyg, suppressSurroundingTagDuringWysiwygRendering |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPanelMacro()
Method Detail |
---|
protected abstract String getPanelCSSClass()
protected abstract String getPanelHeaderCSSClass()
protected abstract String getPanelContentCSSClass()
public void setSubRenderer(SubRenderer subRenderer)
public boolean hasBody()
Macro
protected String getBodyContent(Map parameters, String body, RenderContext renderContext) throws MacroException
MacroException
protected String getTitle(Map parameters, String body, RenderContext renderContext)
public boolean isInline()
Macro
Most macros will want to return false here.
public RenderMode getBodyRenderMode()
Macro
If this method returns null, it causes the macro processor to treat the macro as one that returns wiki-text rather than HTML. The body of the macro will be passed in un-rendered, and the macro's output will be inserted back into the page for further normal processing by the wiki-engine.
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException
Macro
Macro.getBodyRenderMode()
).
Macros are expected to output HTML. The output of macros will not be subjected to any
further processing by the wiki-engine. If your macro produces wiki-text, you are responsible
for rendering that text to HTML yourself using a SubRenderer
or WikiStyleRenderer
. If your macro returns pure wiki-text, you
can force further processing in the normal chain by returning null from Macro.getBodyRenderMode()
parameters
- the parameters included in the macrobody
- the content of the body of the macrorenderContext
- the rendering context in which the macro was executed
MacroException
- if the macro fails in some unremarkable way. If the
macro fails in a way that is important to the server maintainer
(i.e. something is badly wrong), throw a RuntimeException instead.protected void writeHeader(RenderContext renderContext, StringBuffer buffer, String title, String borderStyle, String borderColor, int borderWidth, String titleBackgroundColor)
protected void writeContent(StringBuffer buffer, Map parameters, String content, String backgroundColor)
protected SubRenderer getSubRenderer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |