Package org.apache.wicket.markup.html.tree

Examples of org.apache.wicket.markup.html.tree.Tree


    // construct the panel
    add(new RecursivePanel("panels", l1));

    // create a tree
    TreeModel treeModel = convertToTreeModel(l1);
    final Tree tree = new Tree("tree", treeModel)
    {
      protected String renderNode(TreeNode node)
      {
        DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)node;
        Object userObject = treeNode.getUserObject();
        return (userObject instanceof List) ? "<subtree>" : String.valueOf(treeNode
            .getUserObject());
      }
    };
    // disable ajax links in this example
    tree.setLinkType(LinkType.REGULAR);

    add(tree);
    add(new Link("expandAll")
    {
      public void onClick()
      {
        tree.getTreeState().expandAll();
      }
    });

    add(new Link("collapseAll")
    {
      public void onClick()
      {
        tree.getTreeState().collapseAll();
      }
    });

    add(new BookmarkablePageLink("ajaxTreeLink", SimpleTreePage.class));
  }
View Full Code Here


   * Page constructor
   *
   */
  public SimpleTreePage()
  {
    tree = new Tree("tree", createTreeModel())
    {
      protected String renderNode(TreeNode node)
      {
        ModelBean bean = (ModelBean)((DefaultMutableTreeNode)node).getUserObject();
        return bean.getProperty1();
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.tree.Tree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.