org.xwiki.rendering.block
Class MacroMarkerBlock

java.lang.Object
  extended by org.xwiki.rendering.block.AbstractBlock
      extended by org.xwiki.rendering.block.MacroMarkerBlock
All Implemented Interfaces:
Cloneable, Block

public class MacroMarkerBlock
extends AbstractBlock

A special block that Macro Blocks generate when they are executed so that it's possible to reconstruct the initial syntax even after Macros have been executed. For example this is important in a WYSWIYG editor where you want to show the Macro's rendered result and also let users modify the macro content.

Since:
1.5M2
Version:
$Id$

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xwiki.rendering.block.Block
Block.Axes
 
Constructor Summary
MacroMarkerBlock(String id, Map<String,String> parameters, List<Block> childBlocks, boolean isInline)
           
MacroMarkerBlock(String id, Map<String,String> parameters, String content, List<Block> childBlocks, boolean isInline)
           
 
Method Summary
 void after(Listener listener)
          Send Listener events corresponding to the end of the block.
 void before(Listener listener)
          Send Listener events corresponding to the start of the block.
 String getContent()
           
 String getId()
           
 String getName()
          Deprecated. since 2.4M1 use getId() instead
 boolean isInline()
           
 
Methods inherited from class org.xwiki.rendering.block.AbstractBlock
addChild, addChildren, clone, clone, equals, getBlocks, getChildren, getFirstBlock, getNextSibling, getParameter, getParameters, getParent, getPreviousSibling, getRoot, hashCode, insertChildAfter, insertChildBefore, removeBlock, replaceChild, replaceChild, setChildren, setNextSiblingBlock, setParameter, setParameters, setParent, setPreviousSiblingBlock, traverse
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroMarkerBlock

public MacroMarkerBlock(String id,
                        Map<String,String> parameters,
                        List<Block> childBlocks,
                        boolean isInline)
Parameters:
id - the name of the macro
parameters - the parameters of the macro
childBlocks - the list of children blocks generated by the macro
isInline - indicate if the macro is located in a inline content (like paragraph, etc.)

MacroMarkerBlock

public MacroMarkerBlock(String id,
                        Map<String,String> parameters,
                        String content,
                        List<Block> childBlocks,
                        boolean isInline)
Parameters:
id - the name of the macro
parameters - the parameters of the macro
content - the content of the macro. Null if the macro does not have content
childBlocks - the list of children blocks generated by the macro
isInline - indicate if the macro is located in a inline content (like paragraph, etc.)
Method Detail

getName

@Deprecated
public String getName()
Deprecated. since 2.4M1 use getId() instead

Returns:
the macro name.

getId

public String getId()
Returns:
the macro identifier.
Since:
2.4M1

getContent

public String getContent()
Returns:
the macro content.

isInline

public boolean isInline()
Returns:
if true the macro is located in a inline content (like paragraph, etc.).

before

public void before(Listener listener)
Description copied from class: AbstractBlock
Send Listener events corresponding to the start of the block. For example for a Bold block, this allows an XHTML Listener (aka a Renderer) to output <b>.

Overrides:
before in class AbstractBlock
Parameters:
listener - the listener that will receive the events sent by this block before its children blocks have emitted their own events.

after

public void after(Listener listener)
Description copied from class: AbstractBlock
Send Listener events corresponding to the end of the block. For example for a Bold block, this allows an XHTML Listener (aka a Renderer) to output </b>.

Overrides:
after in class AbstractBlock
Parameters:
listener - the listener that will receive the events sent by this block before its children blocks have emitted their own events.


Copyright © 2004-2012 XWiki. All Rights Reserved.