Package com.gwtext.client.widgets.tree

Examples of com.gwtext.client.widgets.tree.TreePanel


        super(title);
        this.centertabbedPanel = centertabbedPanel;
    }

    protected TreePanel basicTreeStructure(TreeNode basenode, TreePanelListenerAdapter listener) {
        TreePanel adminTreePanel = genericExplorerWidget(basenode);
        adminTreePanel.addListener(listener);
        return adminTreePanel;
    }
View Full Code Here


        return adminTreePanel;
    }

    public static TreePanel genericExplorerWidget(final TreeNode childNode) {
        // create and configure the main tree
        final TreePanel menuTree = new TreePanel();
        menuTree.setAnimate(true);
        menuTree.setEnableDD(false);
        menuTree.setContainerScroll(true);
        menuTree.setRootVisible(true);
        menuTree.setBodyBorder(false);
        menuTree.setBorder(false);
        menuTree.setRootNode(childNode);
        menuTree.setAutoScroll(true);
        menuTree.setContainerScroll(true);


//        menuTree.setTitle("Tree View");
//        menuTree.setId("nav-tree");
//        menuTree.setWidth(180);
View Full Code Here

    private Widget packageExplorer(final ExplorerViewCenterPanel tabPanel) {
        TreeNode root = new TreeNode(constants.Packages());
        root.setAttribute("icon", "images/silk/chart_organisation.gif"); //NON-NLS

        final TreePanel panel = genericExplorerWidget(root);


        loadPackages(root);

        TreePanelListener treePanelListener = new TreePanelListenerAdapter() {
            public void onClick(TreeNode node, EventObject e) {
                if (node.getUserObject() instanceof PackageConfigData) {
                    PackageConfigData pc = (PackageConfigData) node.getUserObject();
                    currentPackage = pc.name;
                    String uuid = pc.uuid;
                    centertabbedPanel.openPackageEditor(uuid, new Command() {
                        public void execute() {
                            //refresh the package tree.
                            refreshPackageTree();
                        }
                    });
                } else if (node.getUserObject() instanceof Object[]) {
                    Object[] uo = (Object[]) node.getUserObject();
                    final String[] fmts = (String[]) uo[0];
                    final PackageConfigData pc = (PackageConfigData) node.getParentNode().getUserObject();
                    currentPackage = pc.name;
                    String key = key(fmts, pc);
                    if (!centertabbedPanel.showIfOpen(key)) {
                        AssetItemGrid list = new AssetItemGrid(new EditItemEvent() {
                            public void open(String uuid) {
                                centertabbedPanel.openAsset(uuid);
                            }
                        },
                                AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID,
                                new AssetItemGridDataLoader() {
                                    public void loadData(int skip, int numRows, GenericCallback cb) {
                                        RepositoryServiceFactory.getService().listAssets(pc.uuid, fmts, skip, numRows, AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID, cb);
                                    }
                                }
                        , GWT.getModuleBaseURL() + "feed/package?name=" + pc.name + "&viewUrl=" + Window.Location.getHref() + "&status=*");

                        tabPanel.addTab(uo[1] + " [" + pc.name + "]", true, list, key);
                    }
                }
            }


            @Override
            public void onCollapseNode(final TreeNode node) {
                if (node.getText().equals(constants.Packages())) {
                    Node[] children = node.getChildNodes();
                    for (Node child : children) {
                        node.removeChild(child);
                    }
                    loadPackages(node);
                }
            }


        };
        // register listener
        panel.addListener(treePanelListener);

        ScrollPanel scp = new ScrollPanel(panel);
        scp.setHeight("500px"); //NON-NLS


View Full Code Here

        return false;
    }

    public static TreePanel genericExplorerWidget(final TreeNode childNode) {
        // create and configure the main tree
        final TreePanel menuTree = new TreePanel();
        menuTree.setAnimate(true);
        menuTree.setEnableDD(true);
        menuTree.setContainerScroll(true);
        menuTree.setRootVisible(true);
        menuTree.setBodyBorder(false);
        menuTree.setBorder(false);
        menuTree.setRootNode(childNode);
        return menuTree;
    }
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.tree.TreePanel

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.