Package com.smartgwt.client.widgets.grid

Examples of com.smartgwt.client.widgets.grid.ListGridRecord


        }
    }

    private ListGridRecord createPermissionRecord(String displayName, String icon, Permission permission,
        String description) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute("displayName", displayName);
        record.setAttribute("icon", icon);
        record.setAttribute("name", permission.name());
        record.setAttribute("description", description);
        record.setAttribute("authorized", this.selectedPermissions.contains(permission));

        return record;
    }
View Full Code Here


        return record;
    }

    private ListGridRecord createResourcePermissionRecord(String displayName, String icon, Permission readPermission,
        String readDescription, Permission writePermission, String writeDescription) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute("displayName", displayName);
        record.setAttribute("icon", icon);
        record.setAttribute("readName", readPermission.name());
        record.setAttribute("readAuthorized", this.selectedPermissions.contains(readPermission));
        record.setAttribute("description", "<b>" + MSG.view_adminRoles_permissions_read() + "</b> " + readDescription
            + "<br/><b>" + MSG.view_adminRoles_permissions_write() + "</b> " + writeDescription);
        record.setAttribute("writeName", writePermission.name());
        record.setAttribute("writeAuthorized", this.selectedPermissions.contains(writePermission));

        return record;
    }
View Full Code Here

        }
        JavaScriptObject[] jsArray = JSOHelper.toArray(jsObject);
        ListGridRecord[] records = new ListGridRecord[jsArray.length];
        for (int i = 0; i < jsArray.length; i++) {
            JavaScriptObject jsArrayItem = jsArray[i];
            ListGridRecord record = (ListGridRecord) RefDataClass.getRef(jsArrayItem);
            if (record == null) {
                record = new ListGridRecord(jsArrayItem);
            }
            records[i] = record;
        }
        return records;
    }
View Full Code Here

        });
    }

    @Override
    public ListGridRecord copyValues(ProblemResourceComposite from) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute("id", from.getResourceId());
        record.setAttribute(Field.ALERTS.propertyName, from.getNumAlerts());
        record.setAttribute(Field.AVAILABILITY.propertyName, ImageManager.getAvailabilityIconFromAvailType(from
            .getAvailabilityType()));
        record.setAttribute(Field.RESOURCE.propertyName, from.getResourceName());

        // for ancestry handling
        record.setAttribute(AncestryUtil.RESOURCE_NAME, from.getResourceName());
        record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, from.getAncestry());
        record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, from.getResourceTypeId());

        record.setAttribute("entity", from);
        return record;
    }
View Full Code Here

    public ListGridRecord copyValues(DriftComposite from) {
        return convert(from);
    }

    public static ListGridRecord convert(DriftComposite from) {
        ListGridRecord record = new ListGridRecord();
        Drift<?, ?> drift = from.getDrift();
        record.setAttribute(ATTR_ID, drift.getId());
        record.setAttribute(ATTR_CTIME, new Date(drift.getCtime()));
        switch (drift.getChangeSet().getCategory()) {
        case COVERAGE:
            record.setAttribute(ATTR_CATEGORY, ImageManager.getDriftCategoryIcon(null));
            break;
        case DRIFT:
            record.setAttribute(ATTR_CATEGORY, ImageManager.getDriftCategoryIcon(drift.getCategory()));
            break;
        }
        record.setAttribute(ATTR_PATH, drift.getPath());
        record.setAttribute(ATTR_CHANGESET_DEF_NAME, from.getDriftDefinitionName());
        record.setAttribute(ATTR_CHANGESET_VERSION, drift.getChangeSet().getVersion());

        // for navigation needs
        record.setAttribute(ATTR_CHANGESET_DEF_ID, drift.getChangeSet().getDriftDefinitionId());

        // for ancestry handling    
        Resource resource = from.getResource();
        if (resource != null) {
            record.setAttribute(AncestryUtil.RESOURCE_ID, resource.getId());
            record.setAttribute(AncestryUtil.RESOURCE_NAME, resource.getName());
            record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, resource.getAncestry());
            record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, resource.getResourceType().getId());
        }

        return record;
    }
View Full Code Here

        return null; // TODO: Implement this method.
    }

    @Override
    public ListGridRecord copyValues(Tag from) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute("id", from.getId());
        record.setAttribute("namespace", from.getNamespace());
        record.setAttribute("semantic", from.getSemantic());
        record.setAttribute("name", from.getName());
        record.setAttribute("tag", from.toString());
        return record;
    }
View Full Code Here

        return resource;
    }

    @Override
    public ListGridRecord copyValues(Resource from) {
        ListGridRecord record = new ListGridRecord();

        record.setAttribute("resource", from);
        record.setAttribute("id", from.getId());
        record.setAttribute("uuid", from.getUuid());
        record.setAttribute(NAME.propertyName(), from.getName());
        record.setAttribute(KEY.propertyName(), from.getResourceKey());
        record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
        record.setAttribute(LOCATION.propertyName(), from.getLocation());
        record.setAttribute(TYPE.propertyName(), from.getResourceType().getId());
        record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin());
        record.setAttribute(VERSION.propertyName(), from.getVersion());
        record.setAttribute(CATEGORY.propertyName(), from.getResourceType().getCategory().name());
        record.setAttribute("icon", ImageManager.getResourceIcon(from.getResourceType().getCategory(), from
            .getCurrentAvailability().getAvailabilityType()));
        record.setAttribute(AVAILABILITY.propertyName(),
            ImageManager.getAvailabilityIconFromAvailType(from.getCurrentAvailability().getAvailabilityType()));
        record.setAttribute(CTIME.propertyName(), from.getCtime());
        record.setAttribute(ITIME.propertyName(), from.getItime());
        record.setAttribute(MTIME.propertyName(), from.getMtime());
        record.setAttribute(MODIFIER.propertyName(), from.getModifiedBy());
        record.setAttribute(INVENTORY_STATUS.propertyName(), from.getInventoryStatus().name());

        record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, from.getAncestry());
        record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, from.getResourceType().getId());

        return record;
    }
View Full Code Here

    @Override
    public ListGridRecord copyValues(MetricDisplaySummary from) {
        MeasurementUtility.formatSimpleMetrics(from);

        ListGridRecord record = new ListGridRecord();
        record.setAttribute(SPARKLINE.getValue(), getCsvMetricsForSparkline(from.getDefinitionId()));
        record.setAttribute(METRIC_LABEL.getValue(), from.getLabel());
        record.setAttribute(ALERT_COUNT.getValue(), String.valueOf(from.getAlertCount()));
        record.setAttribute(MIN_VALUE.getValue(), getMetricStringValue(from.getMinMetric()));
        record.setAttribute(MAX_VALUE.getValue(), getMetricStringValue(from.getMaxMetric()));
        record.setAttribute(AVG_VALUE.getValue(), getMetricStringValue(from.getAvgMetric()));
        record.setAttribute(METRIC_DEF_ID.getValue(), from.getDefinitionId());
        record.setAttribute(METRIC_SCHEDULE_ID.getValue(), from.getScheduleId());
        record.setAttribute(METRIC_UNITS.getValue(), from.getUnits());
        record.setAttribute(METRIC_NAME.getValue(), from.getMetricName());
        record.setAttribute(RESOURCE_GROUP_ID.getValue(), resourceGroup.getId());
        return record;
    }
View Full Code Here

    protected void editRecord(Record record) {
    }

    // Subclasses will generally want to override this.
    protected Record createNewRecord() {
        return new ListGridRecord();
    }
View Full Code Here

        return null; // TODO: Implement this method.
    }

    @Override
    public ListGridRecord copyValues(EventComposite from) {
        ListGridRecord record = new ListGridRecord();

        record.setAttribute("id", from.getEventId());
        record.setAttribute("timestamp", from.getTimestamp());
        record.setAttribute("detail", from.getEventDetail());
        record.setAttribute("severity", from.getSeverity().name());
        record.setAttribute("source", from.getSourceLocation());

        // for ancestry handling
        record.setAttribute(AncestryUtil.RESOURCE_ID, from.getResourceId());
        record.setAttribute(AncestryUtil.RESOURCE_NAME, from.getResourceName());
        record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, from.getResourceAncestry());
        record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, from.getResourceTypeId());

        return record;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.grid.ListGridRecord

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.