|
PAJES 2.3.9 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
| TreeFactory | Factory to produce TreePaje instances. |
| TreeImage | Handles the return of the images used in the tree display. |
| TreePaje | Creates a frame set containing a client-side tree control. |
| TreeScript | Handles the return of the JavaScript source file used to construct and display the tree. |
| TreeStyleSheet | Handles the return of the default style sheet used to format the tree. |
| Exception Summary | |
| TreeException | Thrown when a run-time exception relating to the construction of an HTML tag occurs. |
Used to construct an HTML frameset containing a Windows Explorer-like tree display. The following is an example of how a tree display servlet can be constructed:
import org.pajes.html.tree.TreePaje;
import org.pajes.html.tree.TreeFactory;
import org.pajes.servlet.PajeServlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Tree extends PajeServlet {
private TreeFactory factory;
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// Create a tree document
TreePaje doc = (TreePaje)this.factory.create(request);
// Define the root node (everything is based on the root node)
TreePaje.Node root = doc.setRootNode("Test", null, true);
// Create two second level nodes that do nothing but open and close
TreePaje.Node level1 = doc.makeNode("Level1", "Level 1", null, false);
TreePaje.Node level2 = doc.makeNode("Level2", "Level 2", null, false);
// Create a node that has an URL (it does something when you
// click on it apart from opening/closong any children)
TreePaje.Node list = doc.makeNode("Persons", "Persons", "some URL", false);
// Add the children to the root node
root.addChild(level1);
root.addChild(level2);
// Add the actual thing to level 1
level1.addChild(list);
// Set the tree and page titles
doc.setTreeTitle("Tree");
doc.getHead().setPageTitle("Tree");
// Send the result back to the browser
doc.write(this.getServletContext(), request, response);
}
public void init() throws ServletException {
try {
// Initialise the factory that produces tree framesets
this.factory = new TreeFactory(this.getServletContext());
}
catch (Exception e) {
throw new ServletException(e);
}
}
}
|
PAJES 2.3.9 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||