public class NoformatMacro extends AbstractPanelMacro
| Modifier and Type | Field and Description |
|---|---|
static String |
PREFORMATTED_CONTENT_WRAPPER_CLASS
Class given to the div that wraps the preformatted block.
|
RAW_PARAMS_KEY| Constructor and Description |
|---|
NoformatMacro() |
NoformatMacro(V2SubRenderer subRenderer) |
| Modifier and Type | Method and Description |
|---|---|
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 String |
getPanelContentCSSClass() |
protected String |
getPanelCSSClass() |
protected String |
getPanelHeaderCSSClass() |
TokenType |
getTokenType(Map parameters,
String body,
RenderContext context)
Declares what sort of html elements are returned by the macro.
|
boolean |
suppressMacroRenderingDuringWysiwyg()
Suppress the rendering of the macro -- the macro's body may still be rendered (depending on the render mode of
the macro), but the HTML the macro adds will not be created.
|
getSubRenderer, getTitle, hasBody, isInline, setSubRenderer, writeContent, writeHeader, writeHeadergetWysiwygBodyType, suppressSurroundingTagDuringWysiwygRenderingpublic static final String PREFORMATTED_CONTENT_WRAPPER_CLASS
public NoformatMacro()
public NoformatMacro(V2SubRenderer subRenderer)
protected String getPanelCSSClass()
getPanelCSSClass in class AbstractPanelMacroprotected String getPanelHeaderCSSClass()
getPanelHeaderCSSClass in class AbstractPanelMacroprotected String getPanelContentCSSClass()
getPanelContentCSSClass in class AbstractPanelMacropublic String execute(Map parameters, String body, RenderContext renderContext) throws MacroException
MacroMacro.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()
execute in interface Macroexecute in class AbstractPanelMacroparameters - the parameters included in the macrobody - the content of the body of the macrorenderContext - the rendering context in which the macro was executedMacroException - 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.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.
getBodyRenderMode in interface MacrogetBodyRenderMode in class AbstractPanelMacropublic TokenType getTokenType(Map parameters, String body, RenderContext context)
BaseMacroTokenType.INLINE elements will have paragraphs drawn around them, or be incorporated into paragraphs
they are included in.
TokenType.BLOCK elements will be treated as their own paragraph, splitting any paragraphs they
would otherwise be in.
TokenType.INLINE_BLOCK elements will not have paragraphs drawn around them, but they won't split any
paragraphs they appear in either.
Macros that contain elements that shouldn't appear in a paragraph, such as pre, should return
TokenType.BLOCK. If it produces a span, replacement text or text decoration, return
TokenType.INLINE. If it affects logic of whether its children are displayed but doesn't add its own
content, or you aren't sure what to return, return TokenType.INLINE_BLOCK.
The default implementation tries to maintain backward compatibility with most macros. It returns
TokenType.INLINE for macros that return true from BaseMacro.isInline() and
TokenType.INLINE_BLOCK for macros that return false.
getTokenType in interface MacrogetTokenType in class BaseMacroparameters - ignoredbody - ignoredcontext - ignoredprotected String getBodyContent(Map parameters, String body, RenderContext renderContext) throws MacroException
getBodyContent in class AbstractPanelMacroMacroExceptionpublic boolean suppressMacroRenderingDuringWysiwyg()
MacrosuppressMacroRenderingDuringWysiwyg in interface MacrosuppressMacroRenderingDuringWysiwyg in class BaseMacroCopyright © 2019 Atlassian. All rights reserved.