@Override public void beginBlock(BlockType type, Attributes attributes) { out.beginBlock(type, attributes); }
private void beginDiv(String... cssClasses) { Attributes attributes = new Attributes(); for (String cssClass : cssClasses) { attributes.appendCssClass(cssClass); } out.beginBlock(BlockType.DIV, attributes); }
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(); } } }
tableAttributes.setBorder("0"); //$NON-NLS-1$ tableAttributes.setSummary("navigation"); //$NON-NLS-1$ out.beginBlock(BlockType.TABLE, tableAttributes); out.beginBlock(BlockType.TABLE_ROW, new Attributes()); tableCellAttributes.setCssStyle("width: 100%"); //$NON-NLS-1$ tableCellAttributes.setColspan("3"); //$NON-NLS-1$ out.beginBlock(BlockType.TABLE_CELL_HEADER, tableCellAttributes); if (rootPage) { out.characters(rootBuilder.getTitle()); out.beginBlock(BlockType.TABLE_ROW, new Attributes()); tableCellAttributes.setAlign("left"); //$NON-NLS-1$ tableCellAttributes.setCssStyle("width: 20%"); //$NON-NLS-1$ out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes); if (previous != null) { linkAttributes = new LinkAttributes(); tableCellAttributes.setAlign("center"); //$NON-NLS-1$ tableCellAttributes.setCssStyle("width: 60%"); //$NON-NLS-1$ out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes); if (!header && !rootPage) { linkAttributes = new LinkAttributes(); tableCellAttributes.setAlign("right"); //$NON-NLS-1$ tableCellAttributes.setCssStyle("width: 20%"); //$NON-NLS-1$ out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes);