Class AbstractBoxMacro<P extends BoxMacroParameters>

  • Type Parameters:
    P - the type of macro parameters bean.
    All Implemented Interfaces:
    Comparable<Macro<?>>, org.xwiki.component.phase.Initializable, Macro<P>

    public abstract class AbstractBoxMacro<P extends BoxMacroParameters>
    extends AbstractMacro<P>
    Draw a box around provided content.
    Since:
    1.7
    Version:
    $Id: ce57b5d4b86600e9a26d3fe8d616defe46f076a2 $
    • Constructor Detail

      • AbstractBoxMacro

        protected AbstractBoxMacro​(String name,
                                   String description,
                                   ContentDescriptor contentDescriptor,
                                   Class<?> parametersBeanClass)
        Creates a new box macro.
        Parameters:
        name - the name of the macro
        description - string describing this macro.
        contentDescriptor - the ContentDescriptor describing the content of this macro.
        parametersBeanClass - class of the parameters bean.
    • Method Detail

      • supportsInlineMode

        public boolean supportsInlineMode()
      • getBlockTitle

        protected List<? extends Block> getBlockTitle​(P parameters,
                                                      String content,
                                                      MacroTransformationContext context)
        Parameters:
        parameters - the macro parameters in the form of a bean defined by the Macro implementation
        content - the content of the macro
        context - the context of the macros transformation process
        Returns:
        the title represented as a list of Blocks
        Since:
        10.10
      • getImageReference

        protected ResourceReference getImageReference​(P parameters,
                                                      String content,
                                                      MacroTransformationContext context)
        Parameters:
        parameters - the macro parameters in the form of a bean defined by the Macro implementation
        content - the content of the macro
        context - the context of the macros transformation process
        Returns:
        the image reference to be displayed in the box
        Since:
        10.10
      • getTitle

        protected String getTitle​(P parameters,
                                  String content,
                                  MacroTransformationContext context)
        Parameters:
        parameters - the macro parameters in the form of a bean defined by the Macro implementation
        content - the content of the macro
        context - the context of the macros transformation process
        Returns:
        the title of the box
        Since:
        10.10
      • getBoxParameters

        protected Map<String,​String> getBoxParameters​(P parameters,
                                                            String content,
                                                            MacroTransformationContext context)
        Parameters:
        parameters - the macro parameters in the form of a bean defined by the Macro implementation
        content - the content of the macro
        context - the context of the macros transformation process
        Returns:
        the map of parameters to build the box, in the same order as we create them when they are retrieved by renderers.
        Since:
        10.10
      • getClassProperty

        protected String getClassProperty()
        Returns:
        the name of the CSS class to use when rendering, in case no cssClass parameter is specified.
      • getMacroContentParser

        protected MacroContentParser getMacroContentParser()
        Returns:
        the macro content parser to use to parse content in wiki syntax