Examples of ListGridRecord


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

        return null;
    }

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

        record.setAttribute("primaryKey", from.getScheduleId() + ":" + from.getTimestamp());
        record.setAttribute(FIELD_METRIC_SCHED_ID, from.getSchedule().getDefinition().getId()); // used for detail view
        record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP, new Date(from.getTimestamp()));
        record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_DISPLAY_NAME, from.getSchedule().getDefinition()
            .getDisplayName());
        record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_VALUE, from.getValue());
        record.setAttribute(FIELD_METRIC_NAME, from.getSchedule().getDefinition().getName());
        record.setAttribute(MeasurementDataTraitCriteria.FILTER_FIELD_RESOURCE_ID, from.getSchedule().getResource().getId());

        return record;
    }
View Full Code Here

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

    }

    @Override
    public ListGridRecord copyValues(MeasurementScheduleComposite from) {

        ListGridRecord record = new ListGridRecord();
        MeasurementDefinition measurementDefinition = from.getMeasurementDefinition();

        record.setAttribute(ATTR_DEFINITION_ID, measurementDefinition.getId());
        record.setAttribute(ATTR_DISPLAY_NAME, measurementDefinition.getDisplayName());
        record.setAttribute(ATTR_DESCRIPTION, measurementDefinition.getDescription());
        record.setAttribute(ATTR_DATA_TYPE, measurementDefinition.getDataType().name().toLowerCase());
        record.setAttribute(ATTR_ENABLED, from.getCollectionEnabled());
        record.setAttribute(ATTR_INTERVAL, from.getCollectionInterval());

        return record;
    }
View Full Code Here

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

        return alertDef;
    }

    @Override
    public ListGridRecord copyValues(AlertDefinition from) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute(FIELD_ID, from.getId());
        record.setAttribute(FIELD_NAME, from.getName());
        record.setAttribute(FIELD_DESCRIPTION, from.getDescription());
        record.setAttribute(FIELD_CTIME, new Date(from.getCtime()));
        record.setAttribute(FIELD_MTIME, new Date(from.getMtime()));
        record.setAttribute(FIELD_ENABLED, ImageManager.getAvailabilityIcon(from.getEnabled()));
        record.setAttribute(FIELD_DELETED, from.getDeleted());
        record.setAttribute(FIELD_PRIORITY, ImageManager.getAlertIcon(from.getPriority()));
        record.setAttribute(FIELD_OBJECT, from);
        return record;
    }
View Full Code Here

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

    private int[] getMeasurementDefinitionIds() {
        ListGridRecord[] records = getListGrid().getSelectedRecords();

        int[] measurementDefinitionIds = new int[records.length];
        for (int i = 0, selectionLength = records.length; i < selectionLength; i++) {
            ListGridRecord record = records[i];
            Integer measurementDefinitionId = record.getAttributeAsInt(SchedulesDataSource.ATTR_DEFINITION_ID);
            measurementDefinitionIds[i] = measurementDefinitionId;
        }
        return measurementDefinitionIds;
    }
View Full Code Here

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

    private void show(Alert alert) {
        destroyMembers();

        Log.info("AlertDetailsView-Alert: " + alert);
        ListGridRecord record = AlertDataSource.convert(alert);
        Log.info("AlertDetailsView-ListGridRecord: " + record);
        addMember(getDetailsTabSet(record));
    }
View Full Code Here

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

        return fields;
    }

    @Override
    public ListGridRecord copyValues(AlertDefinition from) {
        ListGridRecord record = super.copyValues(from);

        Integer parentId = from.getParentId(); // a valid non-zero number means the alert def came from a template
        AlertDefinition groupAlertDefinition = from.getGroupAlertDefinition();
        boolean readOnly = from.isReadOnly();

        if ((parentId == null || parentId.intValue() == 0) && (groupAlertDefinition == null)) {
            record.setAttribute(FIELD_PARENT, "");
            record.setLinkText("");
            record.setAttribute(FIELD_READONLY, MSG.common_val_na());
        } else {
            if (parentId != null && parentId.intValue() != 0) {
                record.setAttribute(
                    FIELD_PARENT,
                    LinkManager.getAdminTemplatesEditLink(AlertDefinitionTemplateTypeView.VIEW_ID.getName(),
                        this.resource.getResourceType().getId()) + "/" + parentId);
                record.setLinkText(MSG.view_alert_definition_for_type());
            } else {
                boolean isAutogroup = groupAlertDefinition.getGroup().getAutoGroupParentResource() != null;
                if (isAutogroup) {
                    record.setAttribute(FIELD_PARENT, "#Resource/AutoGroup/"
                        + groupAlertDefinition.getGroup().getId() + "/Alerts/Definitions/" + groupAlertDefinition.getId());
                }
                else {
                    boolean isAutoCluster = groupAlertDefinition.getGroup().getClusterResourceGroup() != null;
                    if (isAutoCluster) {
                        record.setAttribute(FIELD_PARENT,  "#ResourceGroup/AutoCluster/"
                            + groupAlertDefinition.getGroup().getId() + "/Alerts/Definitions/" + groupAlertDefinition.getId());
                    }
                    else {
                        record.setAttribute(FIELD_PARENT, "#ResourceGroup/"
                            + groupAlertDefinition.getGroup().getId() + "/Alerts/Definitions/" + groupAlertDefinition.getId());
                    }
                }
                record.setLinkText(MSG.view_alert_definition_for_group());
            }
            record.setAttribute(FIELD_READONLY, (readOnly) ? MSG.common_val_yes() : MSG.common_val_no());
        }

        return record;
    }
View Full Code Here

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

        }
        return results;
    }

    private ListGridRecord transform(Message msg) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute(FIELD_TIME, msg.fired);
        record.setAttribute(FIELD_SEVERITY, (msg.severity != null) ? msg.severity.name() : Severity.Info.name());
        record.setAttribute(FIELD_CONCISEMESSAGE, msg.conciseMessage);
        record.setAttribute(FIELD_OBJECT, msg);
        return record;
    }
View Full Code Here

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

        return composite;
    }

    @Override
    public ListGridRecord copyValues(ResourceGroupComposite from) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute("group", from);
        record.setAttribute("id", from.getResourceGroup().getId());
        record.setAttribute(NAME.propertyName(), from.getResourceGroup().getName());
        record.setAttribute(DESCRIPTION.propertyName(), from.getResourceGroup().getDescription());
        record.setAttribute(CATEGORY.propertyName(), from.getResourceGroup().getGroupCategory().name());

        record.setAttribute("explicitCount", String.valueOf(from.getExplicitCount()));
        record.setAttribute("explicitDown", String.valueOf(from.getExplicitDown()));
        record.setAttribute("explicitDisabled", String.valueOf(from.getExplicitDisabled()));
        record.setAttribute("implicitCount", String.valueOf(from.getImplicitCount()));
        record.setAttribute("implicitDown", String.valueOf(from.getImplicitDown()));
        record.setAttribute("implicitDisabled", String.valueOf(from.getImplicitDisabled()));

        record.setAttribute(AVAIL_CHILDREN.propertyName(), getExplicitFormatted(from));
        record.setAttribute(AVAIL_DESCENDANTS.propertyName(), getImplicitFormatted(from));

        if (from.getResourceGroup().getResourceType() != null) {
            record.setAttribute("resourceType", from.getResourceGroup().getResourceType());
            record.setAttribute(TYPE.propertyName(), from.getResourceGroup().getResourceType().getName());
            record.setAttribute(PLUGIN.propertyName(), from.getResourceGroup().getResourceType().getPlugin());
        }

        return record;
    }
View Full Code Here

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

                return (ResourceConfigurationUpdate) from.getAttributeAsObject(Field.OBJECT);
            }

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

                record.setAttribute(Field.ID, from.getId());
                record.setAttribute(Field.DATECREATED, new Date(from.getCreatedTime()));
                record.setAttribute(Field.LASTUPDATED, new Date(from.getModifiedTime()));
                record.setAttribute(Field.USER, from.getSubjectName());
                record.setAttribute(Field.STATUS, from.getStatus().name());

                // for ancestry handling
                Resource resource = from.getResource();
                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());

                record.setAttribute(Field.OBJECT, from);

                return record;
            }
View Full Code Here

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

        return new GroupOperationHistory(null, null, null, null, null, null);
    }

    @Override
    public ListGridRecord copyValues(GroupOperationHistory from) {
        ListGridRecord record = super.copyValues(from);
        record.setAttribute(Field.GROUP, from.getGroup());
        return record;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.