/** * Wrap the output of a macro block with a {@link MacroMarkerBlock}. * * @param macroBlockToWrap the block that should be replaced * @param newBlocks list of blocks to wrap * @return the wrapper */ private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks) { return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(), macroBlockToWrap .getContent(), newBlocks, macroBlockToWrap.isInline()); }
/** * @param headerBlock the section title. * @return the filtered label to use in toc anchor link. */ public List<Block> generateLabel(HeaderBlock headerBlock) { return headerBlock.clone(this).getChildren(); } }
@Override public Block render(Locale locale, Collection<TranslationBundle> bundles, Object... parameters) { return this.block.clone(); } }
Substitution(Block src, XDOM dst) { this.src = src; this.dst = dst.getChildren(); }
@Override public Block render(Locale locale, Collection<TranslationBundle> bundles, Object... parameters) { Block block = new CompositeBlock(); for (TranslationMessageElement element : this.elements) { block.addChild(element.render(locale, bundles, parameters)); } return null; }
/** * {@inheritDoc} * * @see org.xwiki.rendering.block.AbstractBlock#traverse(org.xwiki.rendering.listener.Listener) */ public void traverse(Listener listener) { before(listener); for (Block block : getChildren()) { block.traverse(listener); } after(listener); } }
@Override public Block render(Locale locale, Collection<TranslationBundle> bundles, Object... parameters) { return new CompositeBlock(); }
/** * {@inheritDoc} * * @see java.lang.Object#toString() * @since 1.8RC2 */ @Override public String toString() { return getWord(); } }
/** * {@inheritDoc} * * @see org.xwiki.rendering.block.AbstractBlock#clone(org.xwiki.rendering.block.BlockFilter) * @since 1.8RC2 */ @Override public ImageBlock clone(BlockFilter blockFilter) { ImageBlock clone = (ImageBlock) super.clone(blockFilter); clone.reference = getReference().clone(); return clone; } }
/** * @return the {@link SectionBlock} corresponding to this header */ public SectionBlock getSection() { return (SectionBlock) getParent(); }
/** * {@inheritDoc} * * @see org.xwiki.rendering.block.Block#addChild(org.xwiki.rendering.block.Block) */ public void addChild(Block blockToAdd) { insertChildAfter(blockToAdd, null); }
/** * {@inheritDoc} * * @see org.xwiki.rendering.block.Block#addChildren(java.util.List) */ public void addChildren(List< ? extends Block> blocksToAdd) { for (Block blockToAdd : blocksToAdd) { addChild(blockToAdd); } }
/** * {@inheritDoc} * * @see org.xwiki.rendering.block.AbstractBlock#clone() */ @Override public XDOM clone() { return (XDOM) super.clone(); } }
/** * Construct a block with children blocks and parameters. * * @param childrenBlocks the list of children blocks of the block to construct * @param parameters the parameters to set */ public AbstractFatherBlock(List<Block> childrenBlocks, Map<String, String> parameters) { super(parameters); addChildren(childrenBlocks); }
/** * {@inheritDoc} * * @see org.xwiki.rendering.block.Block#clone() */ @Override public Block clone() { return clone(null); }
/** * @param count the number of empty lines between 2 standalone Blocks */ public EmptyLinesBlock(int count) { setEmptyLinesCount(count); }
/** * {@inheritDoc} * * @see java.lang.Object#toString() * @since 1.8RC2 */ @Override public String toString() { return getProtectedString(); } }
/** * Wrap the output of a macro block with a {@link MacroMarkerBlock}. * * @param macroBlockToWrap the block that should be replaced * @param newBlocks list of blocks to wrap * @return the wrapper */ private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks) { return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(), macroBlockToWrap.getContent(), newBlocks, macroBlockToWrap.isInline()); }
/** * Wrap the output of a macro block with a {@link org.xwiki.rendering.block.MacroMarkerBlock}. * * @param macroBlockToWrap the block that should be replaced * @param newBlocks list of blocks to wrap * @return the wrapper */ private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks) { return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(), macroBlockToWrap.getContent(), newBlocks, macroBlockToWrap.isInline()); } }