public OutlineItem(OutlineItem parent, int level, String id, int offset, int length, String label) { super(); this.parent = parent; this.level = (parent == null) ? 0 : level; if (parent != null && level < parent.getLevel()) { throw new IllegalArgumentException(); } this.id = id; this.offset = offset; this.length = length; this.label = label; if (parent != null) { parent.addChild(this); } }
private String computeTargetFilename(OutlineItem item) { String filenameSuffix = filename.substring(filename.lastIndexOf('.')); return computeName(item.getLevel() == topicBreakLevel ? item.getId() : null, filenameSuffix); }
while (level <= currentItem.getLevel()) { currentItem = currentItem.getParent();
case FIRST: if (!outline.getChildren().isEmpty()) { builder.setTopicBreakLevel(outline.getChildren().get(0).getLevel()); } else { builder.setTopicBreakLevel(1);
private void emitToc(OutlineItem item) { if (item.getChildren().isEmpty()) { return; } if ((item.getLevel() + 1) > maxLevel) { return; } Attributes nullAttributes = new Attributes(); builder.beginBlock(BlockType.NUMERIC_LIST, new Attributes(null, null, "list-style: " + style + ";", null)); //$NON-NLS-1$ //$NON-NLS-2$ for (OutlineItem child : item.getChildren()) { builder.beginBlock(BlockType.LIST_ITEM, nullAttributes); builder.link('#' + child.getId(), child.getLabel()); emitToc(child); builder.endBlock(); } builder.endBlock(); }
protected void emitToc(OutlineItem item) { if (item.getChildren().isEmpty()) { return; } if ((item.getLevel() + 1) > maxLevel) { return; } Attributes nullAttributes = new Attributes(); builder.beginBlock(BlockType.NUMERIC_LIST, new Attributes(null, null, "list-style: " + style + ";", null)); //$NON-NLS-1$ //$NON-NLS-2$ for (OutlineItem child : item.getChildren()) { builder.beginBlock(BlockType.LIST_ITEM, nullAttributes); builder.link('#' + child.getId(), child.getLabel()); emitToc(child); builder.endBlock(); } builder.endBlock(); }
private void emitToc(OutlineItem item) { if (item.getChildren().isEmpty()) { return; } if ((item.getLevel() + 1) > maxLevel) { return; } Attributes nullAttributes = new Attributes(); builder.beginBlock(BlockType.NUMERIC_LIST, new Attributes(null, null, "list-style: " + style + ";", null)); //$NON-NLS-1$ //$NON-NLS-2$ for (OutlineItem child : item.getChildren()) { builder.beginBlock(BlockType.LIST_ITEM, nullAttributes); builder.link('#' + child.getId(), child.getLabel()); emitToc(child); builder.endBlock(); } builder.endBlock(); }