Package com.smartgwt.client.widgets.form.fields

Examples of com.smartgwt.client.widgets.form.fields.StaticTextItem


        form.setWrapItemTitles(false);
        form.setAlign(Alignment.LEFT);

        List<FormItem> items = new ArrayList<FormItem>();

        StaticTextItem nameTextItem = new StaticTextItem("name", MSG.common_title_name());
        nameTextItem.setValue(record.getAttribute("name"));
        nameTextItem.setTooltip("Id = " + record.getAttribute("id"));
        items.add(nameTextItem);

        StaticTextItem descriptionTextItem = new StaticTextItem("description", MSG.common_title_description());
        descriptionTextItem.setValue(record.getAttribute("description"));
        items.add(descriptionTextItem);

        StaticTextItem prioTextItem = new StaticTextItem("priority", MSG.view_alerts_field_priority());
        prioTextItem.setValue(record.getAttribute("priority"));
        LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
        priorityIcons.put(AlertDataSource.PRIORITY_ICON_HIGH, AlertDataSource.PRIORITY_ICON_HIGH);
        priorityIcons.put(AlertDataSource.PRIORITY_ICON_MEDIUM, AlertDataSource.PRIORITY_ICON_MEDIUM);
        priorityIcons.put(AlertDataSource.PRIORITY_ICON_LOW, AlertDataSource.PRIORITY_ICON_LOW);
        prioTextItem.setValueIcons(priorityIcons);
        // shouldn't have to do this, but the data source stores the actual URL of the icon in it, we need to map back to value
        LinkedHashMap<String, String> priorityMap = new LinkedHashMap<String, String>(3);
        priorityMap.put(AlertDataSource.PRIORITY_ICON_HIGH, MSG.common_alert_high());
        priorityMap.put(AlertDataSource.PRIORITY_ICON_MEDIUM, MSG.common_alert_medium());
        priorityMap.put(AlertDataSource.PRIORITY_ICON_LOW, MSG.common_alert_low());
        prioTextItem.setValueMap(priorityMap);
        items.add(prioTextItem);

        StaticTextItem createdTextItem = new StaticTextItem("ctime", MSG.common_title_createTime());
        createdTextItem.setValue(TimestampCellFormatter.format(record.getAttributeAsDate("ctime")));
        items.add(createdTextItem);

        StaticTextItem ackByItem = new StaticTextItem("acknowledgingSubject", MSG.view_alert_details_field_ack_by());
        if (record.getAttribute("acknowledgingSubject") != null) {
            ackByItem.setValue(record.getAttribute("acknowledgingSubject"));
        } else {
            ackByItem.setValue(MSG.view_alerts_field_ack_status_noAck());
        }
        items.add(ackByItem);

        StaticTextItem ackTimeItem = new StaticTextItem("acknowledgeTime", MSG.view_alert_details_field_ack_at());
        Date ack_time = record.getAttributeAsDate("acknowledgeTime");
        if (ack_time != null) {
            ackTimeItem.setValue(TimestampCellFormatter.format(ack_time));
        } else {
            ackTimeItem.setValue(MSG.view_alerts_field_ack_status_noAck());
        }
        items.add(ackTimeItem);

        StaticTextItem recoveryItem = new StaticTextItem("recovery", MSG.view_alert_details_field_recovery_info());
        recoveryItem.setValue(record.getAttribute("recoveryInfo"));
        items.add(recoveryItem);

        StaticTextItem resourceItem = new StaticTextItem("resourceName",
            MSG.view_alert_details_field_watched_resource());
        String resourceUrl = LinkManager.getResourceLink(Integer.parseInt(record.getAttribute("resourceId")));
        resourceItem.setValue(LinkManager.getHref(resourceUrl, record.getAttribute("resourceName")));
        items.add(resourceItem);

        StaticTextItem resourceAncestryItem = new StaticTextItem("resourceAncestry",
            MSG.view_alert_details_field_resource_ancestry());
        resourceAncestryItem.setValue(record.getAttribute("resourceAncestry"));
        items.add(resourceAncestryItem);

        String parentUrl = record.getAttribute("parent");
        if (parentUrl != null) {
            StaticTextItem parentItem = new StaticTextItem("parent", "Parent Definition");
            parentItem.setValue(LinkManager.getHref(parentUrl, record.getLinkText()));
            items.add(parentItem);
        }

        form.setItems(items.toArray(new FormItem[items.size()]));
View Full Code Here


        DynamicForm form = new DynamicForm();
        form.setWrapItemTitles(false);
        form.setAlign(Alignment.LEFT);

        StaticTextItem title = new StaticTextItem("theMessage", MSG.common_title_message());
        title.setValue(message.conciseMessage);

        StaticTextItem severity = new StaticTextItem("severity", MSG.view_messageCenter_messageSeverity());
        FormItemIcon severityIcon = new FormItemIcon();
        severityIcon.setSrc(getSeverityIcon(message.severity));
        severity.setIcons(severityIcon);
        severity.setValue(message.severity.name());

        StaticTextItem date = new StaticTextItem("time", MSG.view_messageCenter_messageTime());
        date.setValue(TimestampCellFormatter.format(message.fired, TimestampCellFormatter.DATE_TIME_FORMAT_FULL));

        StaticTextItem rootCause = new StaticTextItem("rootCause", MSG.view_messageCenter_messageRootCause());
        rootCause.setValue(message.rootCauseMessage);
        rootCause.setVisible(message.rootCauseMessage != null);

        StaticTextItem detail = new StaticTextItem("detail", MSG.view_messageCenter_messageDetail());
        detail.setTitleVAlign(VerticalAlignment.TOP);
        detail.setValue(message.detailedMessage);

        form.setItems(title, severity, date, rootCause, detail);

        final Window dialogWin = new Window();
        dialogWin.setTitle(MSG.common_title_message());
View Full Code Here

            conditionExpression.setDefaultValue(BooleanExpression.ANY.name());
            conditionExpression.setWrapTitle(false);
            conditionExpression.setHoverWidth(300);
            conditionExpression.setTooltip(MSG.view_alert_common_tab_conditions_expression_tooltip());

            conditionExpressionStatic = new StaticTextItem("conditionExpressionStatic",
                MSG.view_alert_common_tab_conditions_expression());
            conditionExpressionStatic.setWrapTitle(false);

            conditionExpressionForm.setFields(conditionExpression, conditionExpressionStatic);
View Full Code Here

            bundleServer.getBundleDeploymentName(wizard.getDestination().getId(), -1, wizard.getPreviousDeployment()
                .getId(), //
                new AsyncCallback<String>() {

                    public void onSuccess(String bundleDeploymentName) {
                        final StaticTextItem nameTextItem = new StaticTextItem("name", MSG
                            .view_bundle_revertWizard_getInfoStep_revertDeployName());
                        nameTextItem.setWidth(300);
                        String escapedBundleDeploymentName = StringUtility.escapeHtml(bundleDeploymentName);
                        wizard.setSubtitle(escapedBundleDeploymentName);
                        nameTextItem.setValue(escapedBundleDeploymentName);

                        final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", MSG
                            .view_bundle_revertWizard_getInfoStep_revertDeployDesc());
                        descriptionTextAreaItem.setWidth(300);
                        String liveDesc = wizard.getLiveDeployment().getDescription();
View Full Code Here

        DynamicForm liveForm = new DynamicForm();
        liveForm.setNumCols(2);
        liveForm.setIsGroup(true);
        liveForm.setGroupTitle("<b>" + MSG.view_bundle_revertWizard_confirmStep_liveDeployment() + "<b>");

        StaticTextItem liveNameItem = new StaticTextItem("liveName", MSG.common_title_name());
        liveNameItem.setTitleAlign(Alignment.LEFT);
        liveNameItem.setAlign(Alignment.LEFT);
        liveNameItem.setWrap(false);
        liveNameItem.setWrapTitle(false);
        liveNameItem.setValue(live.getName());
        liveNameItem.setLeft(20);

        StaticTextItem liveDescItem = new StaticTextItem("liveDesc", MSG.common_title_description());
        liveDescItem.setTitleAlign(Alignment.LEFT);
        liveDescItem.setAlign(Alignment.LEFT);
        liveDescItem.setWrap(true);
        liveDescItem.setWrapTitle(false);
        liveDescItem.setVAlign(VerticalAlignment.TOP);
        liveDescItem.setTitleVAlign(VerticalAlignment.TOP);
        liveDescItem.setValue((null != live.getDescription()) ? live.getDescription() : MSG.common_val_none());

        StaticTextItem liveVersionItem = new StaticTextItem("liveVersion", MSG.view_bundle_bundleVersion());
        liveVersionItem.setTitleAlign(Alignment.LEFT);
        liveVersionItem.setAlign(Alignment.LEFT);
        liveVersionItem.setWrap(false);
        liveVersionItem.setWrapTitle(false);
        liveVersionItem.setValue(live.getBundleVersion().getVersion());

        liveForm.setItems(liveNameItem, liveVersionItem, liveDescItem);
        layout.addMember(liveForm);

        if (prev != null) {
            final DynamicForm prevForm = new DynamicForm();
            prevForm.setNumCols(2);
            prevForm.setIsGroup(true);
            prevForm.setGroupTitle("<b>" + MSG.view_bundle_revertWizard_confirmStep_prevDeployment() + "<b>");

            StaticTextItem prevNameItem = new StaticTextItem("prevName", MSG.common_title_name());
            prevNameItem.setTitleAlign(Alignment.LEFT);
            prevNameItem.setAlign(Alignment.LEFT);
            prevNameItem.setWrap(false);
            prevNameItem.setWrapTitle(false);
            prevNameItem.setValue(prev.getName());

            StaticTextItem prevDescItem = new StaticTextItem("prevDesc", MSG.common_title_description());
            prevDescItem.setTitleAlign(Alignment.LEFT);
            prevDescItem.setAlign(Alignment.LEFT);
            prevDescItem.setWrap(true);
            prevDescItem.setWrapTitle(false);
            prevDescItem.setTitleVAlign(VerticalAlignment.TOP);
            prevDescItem.setVAlign(VerticalAlignment.TOP);
            prevDescItem.setValue((null != prev.getDescription()) ? prev.getDescription() : MSG.common_val_none());

            final StaticTextItem prevVersionItem = new StaticTextItem("prevVersion", MSG.view_bundle_bundleVersion());
            prevVersionItem.setTitleAlign(Alignment.LEFT);
            prevVersionItem.setAlign(Alignment.LEFT);
            prevVersionItem.setWrap(false);
            prevVersionItem.setWrapTitle(false);
            if (prev.getBundleVersion().getVersion() == null) {
                BundleVersionCriteria c = new BundleVersionCriteria();
                c.addFilterId(prev.getBundleVersion().getId());
                bundleServer.findBundleVersionsByCriteria(c, new AsyncCallback<PageList<BundleVersion>>() {

                    @Override
                    public void onSuccess(PageList<BundleVersion> result) {
                        if (result != null && result.size() == 1) {
                            prevVersionItem.setValue(result.get(0).getVersion());
                            prevForm.markForRedraw();
                        }
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        prevVersionItem.setValue("?");
                        prevForm.markForRedraw();
                    }
                });
            } else {
                prevVersionItem.setValue(prev.getBundleVersion().getVersion());
            }

            prevForm.setItems(prevNameItem, prevVersionItem, prevDescItem);
            layout.addMember(prevForm);
        }
View Full Code Here

            disableWhenFiredSelection.setWrapTitle(false);
            disableWhenFiredSelection.setWidth(300);
            disableWhenFiredSelection.setHoverWidth(300);
            disableWhenFiredSelection
                .setTooltip(MSG.view_alert_definition_recovery_editor_disable_when_fired_tooltip());
            disableWhenFiredStatic = new StaticTextItem("disableWhenFiredStatic",
                MSG.view_alert_definition_recovery_editor_disable_when_fired());
            disableWhenFiredStatic.setWrapTitle(false);

            recoverAlertSelection = new SortedSelectItem("recoveryAlert",
                MSG.view_alert_definition_recovery_editor_recovery_alert());
            recoverAlertSelection.setDefaultValue("0");
            recoverAlertSelection.setWrapTitle(false);
            recoverAlertSelection.setHoverWidth(300);
            recoverAlertSelection.setTooltip(MSG.view_alert_definition_recovery_editor_recovery_alert_tooltip());

            recoverAlertStatic = new StaticTextItem("recoveryAlertStatic",
                MSG.view_alert_definition_recovery_editor_recovery_alert());
            recoverAlertStatic.setDefaultValue(getNoRecoveryMenuItemTitle());
            recoverAlertStatic.setWrapTitle(false);
            recoverAlertStatic.setWidth(300);
View Full Code Here

        actionItem.setColSpan(1);
        actionItem.setRowSpan(4);
        actionItem.setShowTitle(false);
        actionItem.setCanvas(getActionLayout());

        StaticTextItem versionItem = new StaticTextItem("version", MSG.common_title_version());
        versionItem.setValue(version.getVersion());

        StaticTextItem liveDeploymentsItem = new StaticTextItem("deployments", MSG.view_bundle_deployments());
        liveDeploymentsItem.setValue(version.getBundleDeployments().size());

        StaticTextItem filesItems = new StaticTextItem("files", MSG.view_bundle_files());
        filesItems.setValue(version.getBundleFiles().size());

        StaticTextItem descriptionItem = new StaticTextItem("description", MSG.common_title_description());
        descriptionItem.setValue(version.getDescription());

        form.setFields(versionItem, actionItem, liveDeploymentsItem, filesItems, descriptionItem);
        return form;
    }
View Full Code Here

     * be further customized by {@link #prepareStaticFormItem()}.
     * 
     * @return the form item used to show the static (read-only) value
     */
    protected FormItem instantiateStaticFormItem() {
        StaticTextItem item = new StaticTextItem();
        return item;
    }
View Full Code Here

        DynamicForm form = new DynamicForm();
        form.setWidth100();
        form.setHeight100();
        form.setWrapItemTitles(false);

        StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
        id.setValue(composite.getEventId());

        StaticTextItem severity = new StaticTextItem("severity", MSG.view_inventory_eventHistory_severity());
        String severityValue = Canvas.imgHTML(ImageManager.getEventSeverityBadge(composite.getSeverity()), 24, 24);
        switch (composite.getSeverity()) {
        case DEBUG:
            severityValue += MSG.common_severity_debug();
            break;
        case INFO:
            severityValue += MSG.common_severity_info();
            break;
        case WARN:
            severityValue += MSG.common_severity_warn();
            break;
        case ERROR:
            severityValue += MSG.common_severity_error();
            break;
        case FATAL:
            severityValue += MSG.common_severity_fatal();
            break;
        }
        severity.setValue(severityValue);

        StaticTextItem source = new StaticTextItem("source", MSG.view_inventory_eventHistory_sourceLocation());
        source.setValue(composite.getSourceLocation());

        StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.view_inventory_eventHistory_timestamp());
        timestamp.setValue(TimestampCellFormatter.format(composite.getTimestamp(),
            TimestampCellFormatter.DATE_TIME_FORMAT_FULL));

        TextAreaItem detail = new TextAreaItem("details", MSG.view_inventory_eventHistory_details());
        detail.setValue(composite.getEventDetail());
        detail.setTitleOrientation(TitleOrientation.TOP);
View Full Code Here

        fields.add(createHeaderTextItem(MSG.common_title_value()));
        fields.add(createHeaderTextItem(MSG.common_title_description()));
    }

    private StaticTextItem createHeaderTextItem(String value) {
        StaticTextItem unsetHeader = new StaticTextItem();
        unsetHeader.setValue(value);
        unsetHeader.setShowTitle(false);
        unsetHeader.setCellStyle("configurationEditorHeaderCell");
        return unsetHeader;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.fields.StaticTextItem

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.