Package com.smartgwt.sample.showcase.client.data

Examples of com.smartgwt.sample.showcase.client.data.ExplorerTreeNode


        boolean isExplorerTreeNode = node instanceof ExplorerTreeNode;
        if (node instanceof CommandTreeNode) {
            CommandTreeNode commandTreeNode = (CommandTreeNode) node;
            commandTreeNode.getCommand().execute();
        } else if (isExplorerTreeNode) {
            ExplorerTreeNode explorerTreeNode = (ExplorerTreeNode) node;
            PanelFactory factory = explorerTreeNode.getFactory();
            if (factory != null) {

                Canvas panel = factory.create();
                panel.setDisabled(disabledModeCB.getValueAsBoolean());
               
                String sampleName = explorerTreeNode.getName();

                String icon = explorerTreeNode.getIcon();
                if (icon == null) {
                    icon = "silk/plugin.png";
                }

                final Window window = new Window();
                window.setKeepInParentRect(true);
                window.setHeaderIcon(icon, 16, 16);
                window.setTitle(sampleName);
                window.setWidth100();
                window.setHeight100();
                window.setShowMinimizeButton(false);
                window.setShowCloseButton(true);
                window.setCanDragReposition(false);
                window.setCanDragResize(false);
                window.setShowShadow(false);
                window.addItem(panel);
                window.setParentElement(parentPanel);
                String nodeID = explorerTreeNode.getNodeID();
                String historyToken = nodeID.substring(0, nodeID.indexOf(idSuffix));
                History.newItem(historyToken, false);
                window.addCloseClickHandler(new CloseClickHandler() {
                    public void onCloseClick(CloseClientEvent event) {
                        History.newItem("", false);
View Full Code Here


            if (!tree.hasChildren(child)) {
                if (searchText != null) {
                    searchText = searchText.toLowerCase();
                    boolean isExplorerTreeNode = child instanceof ExplorerTreeNode;
                    if (isExplorerTreeNode) {
                        ExplorerTreeNode explorerTreeNode = (ExplorerTreeNode) child;
                        //when searching through all nodes, skip the featured section to avoid duplicates
                        if(explorerTreeNode.getNodeID().contains("featured")) continue;
                        if (explorerTreeNode.getName().toLowerCase().contains(searchText)) {
                            data.add(child);
                        } else {
                            PanelFactory factory = explorerTreeNode.getFactory();
                            if (factory != null) {
                                String description = factory.getDescription();
                                if (description != null && description.toLowerCase().contains(searchText)) {
                                    data.add(child);
                                }
View Full Code Here

            public void onClick(ClickEvent event) {
                ExplorerTreeNode[] data = sideNav.getShowcaseData();
                int size = data.length;
                for (int i = 0; i < 15; i++) {
                    int sampleIndex = (int) (size * java.lang.Math.random());
                    ExplorerTreeNode sample = data[sampleIndex];
                    if (sample.getFactory() != null && !(sample instanceof CommandTreeNode)) {
                        showSample(sample);
                        break;
                    }
                }
            }
View Full Code Here

        boolean isExplorerTreeNode = node instanceof ExplorerTreeNode;
        if (node instanceof CommandTreeNode) {
            CommandTreeNode commandTreeNode = (CommandTreeNode) node;
            commandTreeNode.getCommand().execute();
        } else if (isExplorerTreeNode) {
            ExplorerTreeNode explorerTreeNode = (ExplorerTreeNode) node;
            PanelFactory factory = explorerTreeNode.getFactory();
            if (factory != null) {
                String panelID = factory.getID();
                Tab tab = null;
                if (panelID != null) {
                    String tabID = panelID + "_tab";
                    tab = mainTabSet.getTab(tabID);
                }
                if (tab == null) {
                    Canvas panel = factory.create();
                    tab = new Tab();
                    tab.setID(factory.getID() + "_tab");
                    //store history token on tab so that when an already open is selected, one can retrieve the
                    //history token and update the URL
                    tab.setAttribute("historyToken", explorerTreeNode.getNodeID());
                    tab.setContextMenu(contextMenu);

                    String sampleName = explorerTreeNode.getName();

                    String icon = explorerTreeNode.getIcon();
                    if (icon == null) {
                        icon = "silk/plugin.png";
                    }
                    String imgHTML = Canvas.imgHTML(icon, 16, 16);
                    tab.setTitle("<span>" + imgHTML + "&nbsp;" + sampleName + "</span>");
View Full Code Here

TOP

Related Classes of com.smartgwt.sample.showcase.client.data.ExplorerTreeNode

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.