DTDDoc
Class ElementTreeBuilder

java.lang.Object
  extended by DTDDoc.ElementTreeBuilder

public class ElementTreeBuilder
extends java.lang.Object

Used to build the HTML/Javascript code necessary to set up the d-tree.

Please note we used d-tree code as a basis for our. d-tree was not our original work. Nothing on the original copyright notice stated that we can't use it the way we do. We contacted the author about that but had no answer so far. Therefore, we conclude that we can use his code (and the JavaScript library as well). If some disagree, we'll be able to explain and, if needed, comply...

This class traverses a tree defined as follows:

Emits a tree node for each node in this tree.

Author:
Michael Koehrsen, Stefan Champailler

Constructor Summary
ElementTreeBuilder(java.io.PrintWriter out, DTDCommenter commenter, java.util.Set dtds, Logger log)
           
 
Method Summary
static void generateJavascriptSetup(java.io.PrintWriter out)
          Generates preliminary Javascript code needed to load the d-tree library.
 void generateTree()
          Builds the HTML/Javascript code necessary to the invocation of d-tree.
 void visitContainer(int parentId, com.wutka.dtd.DTDContainer container)
          Visit a container and generate the Javascript d-tree code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementTreeBuilder

public ElementTreeBuilder(java.io.PrintWriter out,
                          DTDCommenter commenter,
                          java.util.Set dtds,
                          Logger log)
Method Detail

generateTree

public void generateTree()
Builds the HTML/Javascript code necessary to the invocation of d-tree.


visitContainer

public void visitContainer(int parentId,
                           com.wutka.dtd.DTDContainer container)
Visit a container and generate the Javascript d-tree code. The children of the container are visited (recursively) as well.

Parameters:
parentId - The parent id of the parent of the container (-1 if none).
container - The container to visit.
Throws:
java.lang.Exception - If anything goes wrong.

generateJavascriptSetup

public static void generateJavascriptSetup(java.io.PrintWriter out)
Generates preliminary Javascript code needed to load the d-tree library.

Parameters:
out - Where to generate the code.


Copyright © 2002-2011 DTDDoc. All Rights Reserved.