Package com.smartgwt.client.data

Examples of com.smartgwt.client.data.Record


            // click an icon, win a chart
            iconField.addRecordClickHandler(new RecordClickHandler() {
                @Override
                public void onRecordClick(RecordClickEvent event) {
                    Record record = event.getRecord();

                    String title = record.getAttribute(NAME.propertyName());
                    ChartViewWindow window = new ChartViewWindow("", title);
                    int defId = record.getAttributeAsInt(GroupMembersComparisonDataSource.ATTR_DEFINITION_ID);

                    ResourceGroup group = groupComposite.getResourceGroup();
                    EntityContext context = EntityContext.forGroup(group);
                    CompositeGroupD3GraphListView graph = new CompositeGroupD3MultiLineGraph(context, defId);
                    window.addItem(graph);
                    graph.populateData();
                    window.show();
                }
            });

            fields.add(iconField);

            ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(), 250);
            nameField.setCellFormatter(new CellFormatter() {
                public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                    String invStatus = record.getAttribute(INVENTORY_STATUS.propertyName());
                    if (InventoryStatus.COMMITTED == InventoryStatus.valueOf(invStatus)) {
                        String url = LinkManager.getResourceLink(record.getAttributeAsInt(ATTR_RESOURCE_ID));
                        String name = StringUtility.escapeHtml(value.toString());
                        return LinkManager.getHref(url, name);
                    } else {
                        return value.toString();
                    }
View Full Code Here


                        throw new RuntimeException(MSG.view_group_operationScheduleDetails_failedToLoadMembers());
                    }
                    Record[] data = response.getData();
                    ListGridRecord[] resourceRecords = new ListGridRecord[data.length];
                    for (int i = 0, dataLength = data.length; i < dataLength; i++) {
                        Record record = data[i];
                        ListGridRecord listGridRecord = (ListGridRecord) record;
                        resourceRecords[i] = listGridRecord;
                    }

                    executionModeForm.setValue(FIELD_EXECUTION_MODE, EXECUTION_ORDER_SEQUENTIAL);
View Full Code Here

        return Field.OPERATION_DISPLAY_NAME;
    }

    @Override
    protected Record createNewRecord() {
        Record record = super.createNewRecord();

        Subject sessionSubject = UserSessionManager.getSessionSubject();
        record.setAttribute(Field.SUBJECT, sessionSubject.getName());
        record.setAttribute(Field.SUBJECT_ID, sessionSubject.getId());

        return record;
    }
View Full Code Here

    }

    @Override
    protected void editExistingRecord(Record record) {
        JavaScriptObject jobTriggerJavaScriptObject = (JavaScriptObject) getForm().getValue(Field.JOB_TRIGGER);
        Record jobTriggerRecord = new ListGridRecord(jobTriggerJavaScriptObject);
        JobTrigger jobTrigger = getDataSource().createJobTrigger(jobTriggerRecord);
        this.triggerEditor.setJobTrigger(jobTrigger);

        FormItem nextFireTimeItem = this.notesForm.getField(Field.NEXT_FIRE_TIME);
        nextFireTimeItem.setValue(getForm().getValue(Field.NEXT_FIRE_TIME));
View Full Code Here

        requestProperties.setAttribute(AbstractOperationScheduleDataSource.RequestProperty.PARAMETERS,
            this.operationParameters);

        EnhancedDynamicForm form = getForm();

        Record jobTriggerRecord = new ListGridRecord();

        Date startTime = this.triggerEditor.getStartTime();
        isImmediateExecution = startTime == null;
        jobTriggerRecord.setAttribute(Field.START_TIME, startTime);

        Date endTime = this.triggerEditor.getEndTime();
        jobTriggerRecord.setAttribute(Field.END_TIME, endTime);

        Integer repeatCount = this.triggerEditor.getRepeatCount();
        jobTriggerRecord.setAttribute(Field.REPEAT_COUNT, repeatCount);

        Long repeatInterval = this.triggerEditor.getRepeatInterval();
        jobTriggerRecord.setAttribute(Field.REPEAT_INTERVAL, repeatInterval);

        String cronExpression = this.triggerEditor.getCronExpression();
        jobTriggerRecord.setAttribute(Field.CRON_EXPRESSION, cronExpression);

        form.setValue(Field.JOB_TRIGGER, jobTriggerRecord);

        DurationItem timeoutItem = (DurationItem) this.notesForm.getItem(Field.TIMEOUT);
        Long timeout = timeoutItem.getValueAsLong();
View Full Code Here

                throw new RuntimeException(MSG.view_group_operationScheduleDetails_failedToLoadMembers());
            }
            Record[] data = response.getData();
            memberResourceRecords = new ListGridRecord[data.length];
            for (int i = 0, dataLength = data.length; i < dataLength; i++) {
                Record record = data[i];
                ListGridRecord listGridRecord = (ListGridRecord) record;
                memberResourceRecords[i] = listGridRecord;
            }
            latch.countDown();
        }
View Full Code Here

            }
        });
        statusField.addRecordClickHandler(new RecordClickHandler() {
            @Override
            public void onRecordClick(RecordClickEvent event) {
                Record record = event.getRecord();
                String statusStr = record.getAttribute(Field.STATUS);
                OperationRequestStatus status = OperationRequestStatus.valueOf(statusStr);
                if (status == OperationRequestStatus.FAILURE) {
                    final Window winModal = new Window();
                    winModal.setTitle(MSG.common_title_details());
                    winModal.setOverflow(Overflow.VISIBLE);
                    winModal.setShowMinimizeButton(false);
                    winModal.setShowMaximizeButton(true);
                    winModal.setIsModal(true);
                    winModal.setShowModalMask(true);
                    winModal.setAutoSize(true);
                    winModal.setAutoCenter(true);
                    winModal.setShowResizer(true);
                    winModal.setCanDragResize(true);
                    winModal.centerInPage();
                    winModal.addCloseClickHandler(new CloseClickHandler() {
                        @Override
                        public void onCloseClick(CloseClickEvent event) {
                            winModal.markForDestroy();
                        }
                    });

                    HTMLPane htmlPane = new HTMLPane();
                    htmlPane.setMargin(10);
                    htmlPane.setDefaultWidth(500);
                    htmlPane.setDefaultHeight(400);
                    String errorMsg = record.getAttribute(Field.ERROR_MESSAGE);
                    if (errorMsg == null) {
                        errorMsg = MSG.common_status_failed();
                    }
                    htmlPane.setContents("<pre>" + errorMsg + "</pre>");
                    winModal.addItem(htmlPane);
View Full Code Here

                @Override
                public void onRecordClick(RecordClickEvent event) {
                    // we only do something if we really have a parent.
                    // if we have a template parent, we have to get the resource's type and go to the template page for that type
                    // if we have a group parent, we can directly go to the group's alert def page
                    Record record = event.getRecord();
                    AlertDefinition alertDef = copyValues(record);
                    if (alertDef.getParentId() != null && alertDef.getParentId().intValue() > 0) {
                        final Integer templateId = alertDef.getParentId().intValue();
                        final Integer resourceId = alertDef.getResource().getId();
View Full Code Here

            editField.setAlign(Alignment.CENTER);
            editField.setCanGroupBy(false);
            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
View Full Code Here

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

TOP

Related Classes of com.smartgwt.client.data.Record

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.