@Override public void endBlock() { out.endBlock(); }
private void endDiv() { out.endBlock(); }
private void emitToc(OutlineItem item, int level) { if (item.getChildren().isEmpty()) { return; } out.beginBlock(BlockType.NUMERIC_LIST, new Attributes()); for (OutlineItem child : item.getChildren()) { Attributes itemAttributes = new Attributes(); if (isExpandedInTableOfContents(child)) { itemAttributes.appendCssClass("expanded"); //$NON-NLS-1$ } else { itemAttributes.appendCssClass("collapsed"); //$NON-NLS-1$ } out.beginBlock(BlockType.LIST_ITEM, itemAttributes); out.link(getHrefOfHeading(child.getId()), child.getLabel()); emitToc(child, level + 1); out.endBlock(); } out.endBlock(); }
@Override public void beginBlock(BlockType type, Attributes attributes) { ElementInfo elementInfo = blockTypeToElementInfo.get(type); if (elementInfo == null) { throw new IllegalStateException(type.name()); } writeBlockElements(attributes, elementInfo); blockState.push(elementInfo); if (type == BlockType.TABLE) { applyTableAttributes(attributes); } else if (type == BlockType.TABLE_ROW) { applyTableRowAttributes(attributes); } else if (type == BlockType.TABLE_CELL_HEADER || type == BlockType.TABLE_CELL_NORMAL) { applyCellAttributes(attributes); } else if (type == BlockType.BULLETED_LIST || type == BlockType.NUMERIC_LIST) { applyListAttributes(attributes); } else if (type == BlockType.QUOTE) { applyQuoteAttributes(attributes); } else { applyAttributes(attributes); // create the titled panel effect if a title is specified if (attributes.getTitle() != null) { beginBlock(BlockType.PARAGRAPH, new Attributes()); beginSpan(SpanType.BOLD, new Attributes()); characters(attributes.getTitle()); endSpan(); endBlock(); } } }
out.characters(current == null ? "" : current.getLabel()); //$NON-NLS-1$ out.endBlock(); out.endBlock(); out.endBlock(); out.endBlock(); out.endBlock(); out.endBlock(); // navigation row out.characters(previous.getLabel()); out.endBlock(); out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes); out.endBlock(); out.endBlock(); out.endBlock(); // navigation title row out.endBlock(); // table