/** * Create a new ListBlock and add it in the provided parent block. * * @param numbered indicate if the list has to be numbered or with bullets * @param parentBlock the block where to add the new list block. * @return the new list block. */ private ListBLock createChildListBlock(boolean numbered, Block parentBlock) { ListBLock childListBlock = numbered ? new NumberedListBlock(Collections.emptyList()) : new BulletedListBlock(Collections.emptyList()); if (parentBlock != null) { parentBlock.addChild(childListBlock); } return childListBlock; } }
/** * {@inheritDoc} * * @see org.xwiki.rendering.listener.Listener#endList(org.xwiki.rendering.listener.ListType, java.util.Map) */ public void endList(ListType listType, Map<String, String> parameters) { if (listType == ListType.BULLETED) { this.stack.push(new BulletedListBlock(generateListFromStack(), parameters)); } else { this.stack.push(new NumberedListBlock(generateListFromStack(), parameters)); } }
public void endList(WikiParameters params, boolean ordered) { ListBLock listBlock; if (ordered) { listBlock = new NumberedListBlock(generateListFromStack(), convertParameters(params)); } else { listBlock = new BulletedListBlock(generateListFromStack(), convertParameters(params)); } this.stack.push(listBlock); }