Package com.smartgwt.client.widgets.tree

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


    setShowSortArrow(SortArrow.CORNER);
    setShowAllRecords(true);
    setLoadDataOnDemand(false);
    setCanSort(false);

    TreeGridField field = new TreeGridField();
    field.setCanFilter(true);
    field.setName("name");
    field.setTitle("<b>" + I18nProvider.getSampleMessages().sampleTitle("1.8.0") + "</b>");
    setFields(field);

    Tree tree = new Tree();
    tree.setModelType(TreeModelType.PARENT);
    tree.setIdField("nodeId");
View Full Code Here


        treeGrid.setWrapCells(true);
        treeGrid.setFixedRecordHeights(false);
        treeGrid.setFolderIcon(ImageManager.getDiscoveryQueuePlatformIconBase());
        treeGrid.setNodeIcon(ImageManager.getResourceIcon(ResourceCategory.SERVER));

        final TreeGridField name, key, type, description, status, ctime;
        name = new TreeGridField("name");
        key = new TreeGridField("resourceKey");
        type = new TreeGridField("typeName");
        description = new TreeGridField("description");
        status = new TreeGridField("statusLabel");
        ctime = new TreeGridField("ctime");
        TimestampCellFormatter.prepareDateField(ctime);

        if (!simple) {
            treeGrid.setFields(name, key, type, description, status, ctime);
        } else {
View Full Code Here

        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);
View Full Code Here

            setSelectionType(SelectionStyle.NONE);
            setAnimateFolders(false);

            ArrayList<ListGridField> fields = new ArrayList<ListGridField>(7);

            final TreeGridField nameField = new TreeGridField(ResourceTypeTreeNodeBuilder.ATTRIB_NAME,
                MSG.common_title_name());
            fields.add(nameField);

            final TreeGridField pluginField = new TreeGridField(ResourceTypeTreeNodeBuilder.ATTRIB_PLUGIN,
                MSG.common_title_plugin());
            fields.add(pluginField);

            fields.addAll(getAdditionalListGridFields(true));

            ListGridField editField = new TreeGridField(ResourceTypeTreeNodeBuilder.ATTRIB_EDIT, getEditColumnTitle());
            editField.setType(ListGridFieldType.IMAGE);
            editField.setAlign(Alignment.CENTER);
            editField.addRecordClickHandler(new RecordClickHandler() {

                public void onRecordClick(final RecordClickEvent event) {
                    Record record = event.getRecord();
                    String editAttr = record.getAttribute(ResourceTypeTreeNodeBuilder.ATTRIB_EDIT);
                    if (ImageManager.getEditIcon().equals(editAttr)) {
                        String type = record.getAttribute(ResourceTypeTreeNodeBuilder.ATTRIB_ID);
                        String editLink = getEditLink(type);
                        if (editLink != null) {
                            CoreGUI.goToView(editLink);
                        } else {
                            // there is no subcanvas to go to - the subclass can do it without changing canvas
                            ResourceTypeRepository.Cache.getInstance().getResourceTypes(Integer.parseInt(type),
                                getTypeMetadataTypes(), new ResourceTypeRepository.TypeLoadedCallback() {
                                    public void onTypesLoaded(ResourceType type) {
                                        editTemplates(type, event);
                                    }
                                });
                        }
                    }
                }
            });
            fields.add(editField);

            nameField.setWidth("*");
            pluginField.setWidth("20%");
            // note that the additional fields should set their own width
            editField.setWidth("70");

            setFields(fields.toArray(new ListGridField[fields.size()]));
        }
View Full Code Here

    @Override
    protected Collection<ListGridField> getAdditionalListGridFields(boolean isTreeGrid) {
        List<ListGridField> fields = new ArrayList<ListGridField>(1);

        ListGridField enabledTemplatesField = (isTreeGrid) ? new TreeGridField(ATTR_ENABLED, MSG.common_title_enabled())
            : new ListGridField(ATTR_ENABLED, MSG.common_title_enabled());
        enabledTemplatesField.setWidth("150");
        enabledTemplatesField.setAlign(Alignment.CENTER);
        // enabledTemplatesField.setPrompt(MSG.common_title_enabled());
        enabledTemplatesField.setType(ListGridFieldType.IMAGE);
View Full Code Here

    @Override
    protected Collection<ListGridField> getAdditionalListGridFields(boolean isTreeGrid) {
        List<ListGridField> fields = new ArrayList<ListGridField>(2);

        ListGridField enabledTemplatesField = (isTreeGrid) //
        ? new TreeGridField(ATTR_ENABLED_TEMPLATES, MSG.view_adminTemplates_enabledTemplates())
            : new ListGridField(ATTR_ENABLED_TEMPLATES, MSG.view_adminTemplates_enabledTemplates());
        enabledTemplatesField.setWidth("150");
        enabledTemplatesField.setAlign(Alignment.CENTER);
        enabledTemplatesField.setPrompt(MSG.view_adminTemplates_prompt_enabledMetricTemplates());
        fields.add(enabledTemplatesField);

        ListGridField disabledTemplatesField = (isTreeGrid) //
        ? new TreeGridField(ATTR_DISABLED_TEMPLATES, MSG.view_adminTemplates_disabledTemplates())
            : new ListGridField(ATTR_DISABLED_TEMPLATES, MSG.view_adminTemplates_disabledTemplates());
        disabledTemplatesField.setWidth("150");
        disabledTemplatesField.setAlign(Alignment.CENTER);
        disabledTemplatesField.setPrompt(MSG.view_adminTemplates_prompt_disabledMetricTemplates());
        fields.add(disabledTemplatesField);
View Full Code Here

    @Override
    protected Collection<ListGridField> getAdditionalListGridFields(boolean isTreeGrid) {
        List<ListGridField> fields = new ArrayList<ListGridField>(2);

        ListGridField pluginTemplatesField = (isTreeGrid) //
        ? new TreeGridField(ATTR_PLUGIN_TEMPLATES, MSG.view_adminTemplates_pluginTemplates())
            : new ListGridField(ATTR_PLUGIN_TEMPLATES, MSG.view_adminTemplates_pluginTemplates());
        pluginTemplatesField.setWidth("150");
        pluginTemplatesField.setAlign(Alignment.CENTER);
        fields.add(pluginTemplatesField);

        ListGridField userTemplatesField = (isTreeGrid) //
        ? new TreeGridField(ATTR_USER_TEMPLATES, MSG.view_adminTemplates_userTemplates())
            : new ListGridField(ATTR_USER_TEMPLATES, MSG.view_adminTemplates_userTemplates());
        userTemplatesField.setWidth("150");
        userTemplatesField.setAlign(Alignment.CENTER);
        fields.add(userTemplatesField);
View Full Code Here

    @Override
    protected Collection<ListGridField> getAdditionalListGridFields(boolean isTreeGrid) {
        List<ListGridField> fields = new ArrayList<ListGridField>(1);

        ListGridField policyField = (isTreeGrid) ? new TreeGridField(ATTR_POLICY, MSG.common_title_policy())
            : new ListGridField(ATTR_POLICY, MSG.common_title_policy());
        policyField.setWidth("150");
        policyField.setAlign(Alignment.CENTER);
        policyField.setCanEdit(false);
        fields.add(policyField);
View Full Code Here

    @Override
    protected Collection<ListGridField> getAdditionalListGridFields(boolean isTreeGrid) {
        List<ListGridField> fields = new ArrayList<ListGridField>(2);

        ListGridField enabledTemplatesField = (isTreeGrid) //
        ? new TreeGridField(ATTR_ENABLED_TEMPLATES, MSG.view_adminTemplates_enabledTemplates())
            : new ListGridField(ATTR_ENABLED_TEMPLATES, MSG.view_adminTemplates_enabledTemplates());
        enabledTemplatesField.setWidth("150");
        enabledTemplatesField.setAlign(Alignment.CENTER);
        enabledTemplatesField.setPrompt(MSG.view_adminTemplates_prompt_enabledAlertTemplates());
        fields.add(enabledTemplatesField);

        ListGridField disabledTemplatesField = (isTreeGrid) //
        ? new TreeGridField(ATTR_DISABLED_TEMPLATES, MSG.view_adminTemplates_disabledTemplates())
            : new ListGridField(ATTR_DISABLED_TEMPLATES, MSG.view_adminTemplates_disabledTemplates());
        disabledTemplatesField.setWidth("150");
        disabledTemplatesField.setAlign(Alignment.CENTER);
        disabledTemplatesField.setPrompt(MSG.view_adminTemplates_prompt_disabledAlertTemplates());
        fields.add(disabledTemplatesField);
View Full Code Here

        treeGrid.setLoadDataOnDemand(false);

        TreeGridField[] fields = new TreeGridField[2 + titles.size()];

        TreeGridField nameField = new TreeGridField("name", MSG.common_title_name(), 250);
        nameField.setFrozen(true);
        nameField.setCellFormatter(new CellFormatter() {
            public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                if (listGridRecord == null || listGridRecord.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
                    return String.valueOf(o);
                } else {
                    return "<span style=\"color: red;\">" + String.valueOf(o) + "</span>";
                }
            }
        });

        TreeGridField typeField = new TreeGridField("type", MSG.common_title_type(), 80);

        fields[0] = nameField;
        fields[1] = typeField;

        int i = 2;
        for (String title : titles) {
            TreeGridField columnField = new TreeGridField(title, title, 150);
            columnField.setCellFormatter(new CellFormatter() {
                public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                    if (!(listGridRecord instanceof ComparisonTreeNode)) {
                        return "";
                    } else if (listGridRecord.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
                        return String.valueOf(o);
View Full Code Here

TOP

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

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.