Package com.smartgwt.client.widgets.tree

Examples of com.smartgwt.client.widgets.tree.TreeGrid


   * customize certain aspects through subclassing)
   *
   * @return
   */
  protected TreeGrid createTreeGrid() {
    return new TreeGrid();
  }
View Full Code Here


      GWT.log("TODO");
    }
  }

  protected TreeGrid createTreeGridInfoWindowRollover() {
    return new TreeGrid() {
      private HLayout rollOverTools;
      private HLayout emptyRollOver;

      @Override
      protected Canvas getRollOverCanvas(Integer rowNum, Integer colNum) {
View Full Code Here

      }
    };
  }

  protected TreeGrid createTreeGridFullRollover() {
    return new TreeGrid() {
      private HLayout rollOverTools;
      private HLayout emptyRollOver;
      private Canvas[] toolButtons;

      @Override
View Full Code Here

                globalPermissions = (permissions != null) ? permissions : EnumSet.noneOf(Permission.class);

                List<NavigationSection> sections = getNavigationSections();
                sectionsByName = new HashMap<String, NavigationSection>(sections.size());
                for (NavigationSection section : sections) {
                    TreeGrid treeGrid = buildTreeGridForSection(section);
                    addSection(treeGrid);
                    treeGrid.getTree().openAll();
                    sectionsByName.put(section.getName(), section);
                }

                addMember(sectionStack);
                addMember(contentCanvas);
View Full Code Here

    protected abstract Canvas defaultView();

    protected abstract List<NavigationSection> getNavigationSections();

    private TreeGrid buildTreeGridForSection(NavigationSection navigationSection) {
        final TreeGrid treeGrid = new TreeGrid();
        treeGrid.setLeaveScrollbarGap(false);
        treeGrid.setShowHeader(false);
        treeGrid.setSelectionType(SelectionStyle.SINGLE);
        treeGrid.setHeight(50);
//        treeGrid.setExtraSpace(5);
        treeGrid.addStyleName("noOutline");
        treeGrid.setAutoFitData(Autofit.VERTICAL);


        List<NavigationItem> navigationItems = navigationSection.getNavigationItems();
        TreeNode[] treeNodes = new TreeNode[navigationItems.size()];
        for (int i = 0, navigationItemsSize = navigationItems.size(); i < navigationItemsSize; i++) {
            NavigationItem item = navigationItems.get(i);
            final TreeNode treeNode = new EnhancedTreeNode(item.getName(), item.getTitle());
            treeNode.setIcon(item.getIcon());
            treeNode.setEnabled(item.isEnabled());
            treeNodes[i] = treeNode;
        }

        TreeNode rootNode = new EnhancedTreeNode(navigationSection.getName(), navigationSection.getTitle(), treeNodes);
        Tree tree = new Tree();
        tree.setRoot(rootNode);
        treeGrid.setData(tree);

        return treeGrid;
    }
View Full Code Here

        }
    }

    private void initSectionPageTreeGrids() {
        for (String name : treeGrids.keySet()) {
            TreeGrid treeGrid = treeGrids.get(name);
            treeGrid.deselectAllRecords();
            this.currentSectionViewId = null;
            this.currentPageViewId = null;
        }
    }
View Full Code Here

        }
    }

    private void selectSectionPageTreeGridNode(String sectionName, String pageName) {
        for (String name : treeGrids.keySet()) {
            TreeGrid treeGrid = treeGrids.get(name);
            if (!name.equals(sectionName)) {
                treeGrid.deselectAllRecords();
            } else {
                Tree tree = treeGrid.getTree();
                TreeNode node = tree.find(sectionName + "/" + pageName);
                if (node != null) {
                    treeGrid.selectSingleRecord(node);
                } else {
                    CoreGUI.getErrorHandler().handleError(MSG.view_leftNav_unknownPage(pageName, sectionName));
                }
            }
        }
View Full Code Here

    @Override
    protected void onInit() {
        super.onInit();

        treeGrid = new TreeGrid();

        treeGrid.setHeight100();

        dataSource = new AutodiscoveryQueueDataSource(treeGrid);
        treeGrid.setDataSource(dataSource);
View Full Code Here

    @Override
    protected void onDraw() {
        super.onDraw();

        final TreeGrid treeGrid = new CustomResourceTypeTreeGrid();

        treeGrid.setHeight100();

        treeGrid.setTitle(MSG.view_type_resourceTypes());
        treeGrid.setAnimateFolders(false);
        treeGrid.setResizeFieldsInRealTime(true);

        final TreeGridField name, plugin, category;
        name = new TreeGridField("name");
        plugin = new TreeGridField("plugin");
        category = new TreeGridField("category");

        treeGrid.setFields(name, plugin, category);

        addMember(treeGrid);

        ResourceTypeCriteria criteria = new ResourceTypeCriteria();
        criteria.addFilterIgnored((showIgnoredResourceTypes ? (Boolean) null : Boolean.FALSE));
        criteria.fetchParentResourceTypes(true);
        criteria.setPageControl(PageControl.getUnlimitedInstance());

        resourceTypeService.findResourceTypesByCriteria(criteria, new AsyncCallback<PageList<ResourceType>>() {
            public void onFailure(Throwable caught) {
                CoreGUI.getErrorHandler().handleError(MSG.widget_typeTree_loadFail(), caught);
            }

            public void onSuccess(PageList<ResourceType> result) {

                treeGrid.getTree().linkNodes(ResourceTypeTreeDataSource.buildNodes(result));

            }
        });
    }
View Full Code Here

    }

    @Override
    protected void onInit() {
        super.onInit();
        treeGrid = new TreeGrid();
        treeGrid.setDataSource(getDataSource());
        treeGrid.setAutoFetchData(true);
        treeGrid.setTitle(MSG.view_portlet_defaultName_recentlyAddedResources());
        treeGrid.setResizeFieldsInRealTime(true);
        treeGrid.setTreeFieldTitle("Resource Name");
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.tree.TreeGrid

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.