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

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


                    DefaultMutableTreeNode node = getSelectedNode();
                    if (node != null && node.getParent() != null)
                    {
                        DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
                        parentNode.remove(node);
                        LinkTree tree = (PortalTree) getPage().get("siteTree");
                        tree.updateTree(target);
                    }
                }
            }.add(new JavascriptEventConfirmation("onclick", new ResourceModel("action.delete.confirm"))));
            infoForm.add(new AjaxButton("save",new ResourceModel("common.save"), infoForm)
            {
View Full Code Here


            add(metaDataModalWindow = new ModalWindow("modalwindow"));
            // Adding menu tree node
            menuTreeRoot = new DefaultTreeModel(rootNode);
            controlMenuTabs(false);
            final AjaxTabbedPanel menusTab = new AjaxTabbedPanel("menuTabs", menuTabs);
            menuTree = new LinkTree("menuTree", new PropertyModel(this, "menuTreeRoot"))
            {
                @Override
                protected void onNodeLinkClicked(Object node, BaseTree tree,
                        AjaxRequestTarget target)
                {
View Full Code Here

                    link.setTarget(document.getTarget());
                    link.setHidden(document.isHidden());
                    linkAction(link, SAVE_ACTION);
                    node.insert(new DefaultMutableTreeNode(new SiteTreeNode(
                            link)), 0);
                    LinkTree tree = (PortalTree) getPage().get("siteTree");
                    tree.getTreeState().expandNode(node);
                    tree.updateTree(target);
                    ((ModalWindow) AddLinkPanel.this.getParent()).close(target);
                }

                @Override
                protected void onError(AjaxRequestTarget target, Form<?> form)
View Full Code Here

                    folder.setTitle(document.getTitle());
                    folder.setShortTitle(document.getShortTitle());
                    folderAction(folder, SAVE_ACTION);
                    node.insert(new DefaultMutableTreeNode(new SiteTreeNode(
                            folder)), 0);
                    LinkTree tree = (PortalTree) getPage().get("siteTree");
                    tree.getTreeState().expandNode(node);
                    tree.updateTree(target);
                    ((ModalWindow) AddFolderPanel.this.getParent())
                            .close(target);
                }

                @Override
View Full Code Here

                        ((Fragment)page.getRootFragment()).setName(layoutName);
                    }
                    PageAction(page, SAVE_ACTION);
                    node.insert(new DefaultMutableTreeNode(new SiteTreeNode(
                            page)), 0);
                    LinkTree tree = (PortalTree) getPage().get("siteTree");
                    tree.getTreeState().expandNode(node);
                    tree.updateTree(target);
                    ((ModalWindow) AddPagePanel.this.getParent()).close(target);
                }

                @Override
                protected void onError(AjaxRequestTarget target, Form<?> form)
View Full Code Here

            // Adding menu tree node
            DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(new SiteTreeNode("Root", "/", FileType.Folder, false));
            retrieveCopyFolders("/", rootNode);
            copyTreeNode = new DefaultTreeModel(rootNode);
           
            final LinkTree copyTree = new LinkTree("copyTree", new PropertyModel(this, "copyTreeNode"))
            {
                @Override
                protected void onNodeLinkClicked(Object node, BaseTree tree,
                        AjaxRequestTarget target)
                {
                    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node;
                    SiteTreeNode siteNode = (SiteTreeNode) treeNode.getUserObject();
                    boolean needToUpdate = false;
                   
                    if (!tree.getTreeState().isNodeExpanded(treeNode))
                    {
                        if (siteNode.getDocType() == SiteTreeNode.FileType.Folder
                                && !siteNode.isLoaded())
                        {
                            retrieveCopyFolders(siteNode.getNodePath(), treeNode);
                            siteNode.setLoaded(false);
                            needToUpdate = true;
                        }
                       
                        this.getTreeState().expandNode(treeNode);
                    }
                    else
                    {
                        tree.getTreeState().collapseNode(treeNode);
                    }
                   
                    this.getTreeState().selectNode(treeNode, true);
                   
                    if (needToUpdate)
                    {
                        this.updateTree();
                    }
                   
                    setDocPath(siteNode.getNodePath());
                }
            };
           
            copyTree.getTreeState().expandNode(copyTreeNode);
           
            // Initially select the root node in the tree
            copyTree.getTreeState().selectNode(rootNode, true);
            setDocPath(((SiteTreeNode) rootNode.getUserObject()).getNodePath());
           
            add(copyTree);
            add(copyForm);
        }
View Full Code Here

   * Page constructor
   *
   */
  public SimpleTreePage()
  {
    tree = new LinkTree("tree", createTreeModel());
    add(tree);
    tree.getTreeState().collapseAll();
  }
View Full Code Here

    public ResourceKeyTreePanel(final String id, final IModel translateBeanModel) {
        super(id);
        setModel(translateBeanModel);
        setOutputMarkupId(true);

        keyTree = new LinkTree("keyTreePanel", new Model()) {
            private static final long serialVersionUID = 1L;

            @Override
            protected Component newNodeComponent(String id, IModel nodeModel) {
View Full Code Here

        final ModalWindow membershipWin = new ModalWindow("membershipWin");
        membershipWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
        membershipWin.setCookieName("create-membership-modal");
        add(membershipWin);

        BaseTree tree = new LinkTree("treeTable", roleTreeBuilder.build()) {

            private static final long serialVersionUID = -5514696922119256101L;

            @Override
            protected IModel getNodeTextModel(final IModel model) {
                return new PropertyModel(model, "userObject.displayName");
            }

            @Override
            protected void onNodeLinkClicked(final Object node, final BaseTree tree, final AjaxRequestTarget target) {

                final RoleTO roleTO = (RoleTO) ((DefaultMutableTreeNode) node).getUserObject();

                membershipWin.setPageCreator(new ModalWindow.PageCreator() {

                    private static final long serialVersionUID = 7661763358801821185L;

                    private MembershipTO membershipTO;

                    @Override
                    public Page createPage() {

                        for (MembershipTO memberTO : membershipsView.getList()) {

                            if (memberTO.getRoleId() == roleTO.getId()) {
                                return new MembershipModalPage(getPage().getPageReference(), membershipWin, memberTO,
                                        templateMode);
                            }
                        }
                        membershipTO = new MembershipTO();
                        membershipTO.setRoleId(roleTO.getId());
                        membershipTO.setRoleName(roleTO.getName());

                        return new MembershipModalPage(getPage().getPageReference(), membershipWin, membershipTO,
                                templateMode);
                    }
                });
                membershipWin.show(target);
            }
        };

        tree.setOutputMarkupId(true);
        tree.getTreeState().expandAll();

        add(tree);

        membershipsView = new ListView<MembershipTO>("memberships", new PropertyModel<List<? extends MembershipTO>>(
                userTO, "memberships")) {
View Full Code Here

        treeContainer.add(tree);
    }

    private void updateTree() {

        tree = new LinkTree("treeTable", roleTreeBuilder.build()) {

            private static final long serialVersionUID = -5514696922119256101L;

            @Override
            protected IModel getNodeTextModel(final IModel model) {
View Full Code Here

TOP

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

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.