org.xwiki.rendering.block.Block.getNextSibling()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中org.xwiki.rendering.block.Block.getNextSibling()方法的一些代码示例,展示了Block.getNextSibling()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getNextSibling()方法的具体详情如下:
包路径:org.xwiki.rendering.block.Block
类名称:Block
方法名:getNextSibling

Block.getNextSibling介绍

暂无

代码示例

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-api

/**
 * @param block the block to filter out
 * @return the next sibling that is not a protected block or null if not found
 */
public Block getNextSibling(Block block)
{
  Block sibling = block.getNextSibling();
  while (sibling != null && isProtectedBlock(sibling)) {
    sibling = sibling.getNextSibling();
  }
  return sibling;
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-api

/**
 * {@inheritDoc}
 *
 * @see org.xwiki.rendering.block.Block#removeBlock(Block)
 * @since 2.6RC1
 */
public void removeBlock(Block childBlockToRemove)
{
  getChildren().remove(childBlockToRemove);
  if (childBlockToRemove != null) {
    Block previousBlock = childBlockToRemove.getPreviousSibling();
    if (previousBlock != null) {
      previousBlock.setNextSiblingBlock(childBlockToRemove.getNextSibling());
    }
    Block nextBlock = childBlockToRemove.getNextSibling();
    if (nextBlock != null) {
      nextBlock.setPreviousSiblingBlock(previousBlock);
    }
    childBlockToRemove.setNextSiblingBlock(null);
    childBlockToRemove.setPreviousSiblingBlock(null);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-api

previousBlock.setNextSiblingBlock(oldBlock.getNextSibling());
  lastBlock = block;
Block nextBlock = oldBlock.getNextSibling();
if (nextBlock != null) {
  nextBlock.setPreviousSiblingBlock(lastBlock);

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-api

/**
 * {@inheritDoc}
 *
 * @see org.xwiki.rendering.block.Block#insertChildAfter(org.xwiki.rendering.block.Block,
 *      org.xwiki.rendering.block.Block)
 */
public void insertChildAfter(Block blockToInsert, Block previousBlock)
{
  if (previousBlock == null) {
    insertChildBefore(blockToInsert, null);
  } else {
    // If there's a next block to previousBlock then get it to set its previous sibling
    Block nextBlock = previousBlock.getNextSibling();
    if (nextBlock != null) {
      nextBlock.setPreviousSiblingBlock(blockToInsert);
      blockToInsert.setNextSiblingBlock(nextBlock);
    } else {
      blockToInsert.setNextSiblingBlock(null);
    }
    blockToInsert.setPreviousSiblingBlock(previousBlock);
    previousBlock.setNextSiblingBlock(blockToInsert);
    this.childrenBlocks.add(indexOfChild(previousBlock) + 1, blockToInsert);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-rendering-wikimacro-store

wikiMacroBlock.setNextSiblingBlock(syncMetaDataBlock.getNextSibling());
wikiMacroBlock.setPreviousSiblingBlock(syncMetaDataBlock.getPreviousSibling());

相关文章