|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.renderer.v2.macro.BaseMacro
public abstract class BaseMacro
Abstract implementation of Macro which should be extended by all plugin macros. New methods added to
the Macro interface have default implementation added to this class, so Macros that extend
BaseMacro are to some extend future-proofed to API changes.
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.renderer.v2.macro.Macro |
|---|
RAW_PARAMS_KEY |
| Constructor Summary | |
|---|---|
BaseMacro()
|
|
| Method Summary | |
|---|---|
TokenType |
getTokenType(java.util.Map parameters,
java.lang.String body,
RenderContext context)
Declares what sort of html elements are returned by the macro. |
WysiwygBodyType |
getWysiwygBodyType()
Defines how the Macro's body should be rendered for Wysiwyg editors. |
boolean |
isInline()
Deprecated. override getTokenType(java.util.Map, java.lang.String, com.atlassian.renderer.RenderContext) to indicate inline or strict block behaviour. However, for
macros to be backwardly compatible they will still need to implement isInline() too. |
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. |
boolean |
suppressSurroundingTagDuringWysiwygRendering()
Suppress surrounding div/span during Wysiwyg rendering. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.atlassian.renderer.v2.macro.Macro |
|---|
execute, getBodyRenderMode, hasBody |
| Constructor Detail |
|---|
public BaseMacro()
| Method Detail |
|---|
public TokenType getTokenType(java.util.Map parameters,
java.lang.String body,
RenderContext context)
TokenType.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 isInline() and
TokenType.INLINE_BLOCK for macros that return false.
getTokenType in interface Macroparameters - ignoredbody - ignoredcontext - ignored
public boolean isInline()
getTokenType(java.util.Map, java.lang.String, com.atlassian.renderer.RenderContext) to indicate inline or strict block behaviour. However, for
macros to be backwardly compatible they will still need to implement isInline() too.
Most macros will want to return false here.
The default implementation now returns false, which has been a defacto default previously.
isInline in interface Macropublic boolean suppressSurroundingTagDuringWysiwygRendering()
Macro
suppressSurroundingTagDuringWysiwygRendering in interface Macropublic boolean suppressMacroRenderingDuringWysiwyg()
Macro
suppressMacroRenderingDuringWysiwyg in interface Macropublic WysiwygBodyType getWysiwygBodyType()
false from Macro.suppressSurroundingTagDuringWysiwygRendering(),
true from Macro.suppressMacroRenderingDuringWysiwyg() and true from Macro.hasBody().
The default implementation returns WysiwygBodyType.WIKI_MARKUP
for most macros, but WysiwygBodyType.PREFORMAT for macros that
have a Macro.getBodyRenderMode() of RenderMode.NO_RENDER.
getWysiwygBodyType in interface MacroWysiwygBodyType.WIKI_MARKUP or WysiwygBodyType.PREFORMAT
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||