Examples of StaticTextItem


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

    // progress indicator
    barIcon = new FormItemIcon();
    barIcon.setHeight(15);
    barIcon.setWidth(214);
    statusText = new StaticTextItem(messages.printPrefsStatus());
    statusText.setIcons(barIcon);
    barIcon.setSrc("[ISOMORPHIC]/geomajas/plugin/printing/pleasewait-blank.gif");
    // download type
    downloadTypeGroup = new RadioGroupItem();
    downloadTypeGroup.setName("downloadType");
View Full Code Here

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

        changeSetForm.setIsGroup(true);
        changeSetForm.setGroupTitle(MSG.view_drift_table_snapshot());
        changeSetForm.setWrapItemTitles(false);

        DriftChangeSet<?> changeSet = drift.getChangeSet();
        StaticTextItem changeSetId = new StaticTextItem("changeSetId", MSG.common_title_id());
        changeSetId.setValue(changeSet.getId());
        StaticTextItem changeSetCategory = new StaticTextItem("changeSetCategory", MSG.common_title_category());
        changeSetCategory.setValue(changeSet.getCategory().name());
        StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
        changeSetVersion.setValue(changeSet.getVersion());
        StaticTextItem changeSetDriftHandling = new StaticTextItem("changeSetDriftHandling",
            MSG.view_drift_table_driftHandlingMode());
        changeSetDriftHandling.setValue(DriftDefinitionDataSource.getDriftHandlingModeDisplayName(changeSet
            .getDriftHandlingMode()));

        changeSetForm.setItems(changeSetId, changeSetCategory, changeSetVersion, changeSetDriftHandling);

        return changeSetForm;
View Full Code Here

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

    protected FormItem createViewFileLink(String hash, String path, int version, DriftFileStatus status) {
        if (status == LOADED) {
            return createViewFileLink(hash, path, version);
        }
        StaticTextItem item = new StaticTextItem(hash + "_fileLink");
        item.setShowTitle(false);
        item.setValue("(file not ready for viewing)");

        return item;
    }
View Full Code Here

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

                    if (item instanceof EditableFormItem) {
                        ((EditableFormItem) item).setReadOnly(true);
                    }
                    itemsList.add(item);
                } else {
                    StaticTextItem staticItem = new StaticTextItem(item.getName(), item.getTitle());
                    Boolean showTitle = (item.getShowTitle() != null) ? item.getShowTitle() : true;
                    staticItem.setShowTitle(showTitle);
                    staticItem.setTooltip(item.getTooltip());
                    String displayValue = item.getDisplayValue();
                    staticItem.setValue(displayValue);
                    staticItem.setColSpan(item.getAttribute("colSpan"));
                    Boolean outputAsHtml = item.getAttributeAsBoolean(OUTPUT_AS_HTML_ATTRIBUTE);
                    if (Boolean.TRUE.equals(outputAsHtml) && null != displayValue && !displayValue.isEmpty()) {
                        staticItem.setEscapeHTML(true);
                    }
                    // TODO: Any other fields we should copy? icons?

                    if ((item instanceof BooleanItem) || (item instanceof CheckboxItem)) {
                        LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
                        valueMap.put("true", MSG.common_val_yes());
                        valueMap.put("false", MSG.common_val_no());
                        staticItem.setValueMap(valueMap);
                    }

                    itemsList.add(staticItem);
                }
            } else {
                itemsList.add(item);
            }
        }

        // If the dataSource has an "id" field, make sure the form does too.
        if (!hasIdField && getDataSource() != null && getDataSource().getField(FIELD_ID) != null) {
            FormItem idItem;
            if (isNewRecord() != null && isNewRecord() || !CoreGUI.isDebugMode()) {
                idItem = new HiddenItem(FIELD_ID);
            } else {
                idItem = new StaticTextItem(FIELD_ID, MSG.common_title_id());
            }
            itemsList.add(0, idItem);
        }

        for (FormItem item : itemsList) {
View Full Code Here

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

        if (this.isReadOnly) {
            this.form.setNumCols(2);
            this.form.setColWidths("140", "160");

            StaticTextItem staticTextItem = new StaticTextItem(FIELD_VALUE, title);
            staticTextItem.setShowTitle(getShowTitle());

            this.form.setFields(staticTextItem);
        } else {
            this.form.setNumCols(4);
            this.form.setColWidths("140", "90", "105", "*");
 
View Full Code Here

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

        ArrayList<FormItem> formItems = new ArrayList<FormItem>();

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.THRESHOLD);

        String helpStr = MSG.view_alert_definition_condition_editor_metric_threshold_tooltip();
        StaticTextItem helpItem = buildHelpTextItem("thresholdHelp", helpStr, ifFunc);
        formItems.add(helpItem);

        SelectItem metricDropDownMenu = buildMetricDropDownMenu(THRESHOLD_METRIC_ITEMNAME, false, ifFunc, editMode);
        if (metricDropDownMenu != null) {
            formItems.add(metricDropDownMenu);
            formItems.add(buildComparatorDropDownMenu(THRESHOLD_COMPARATOR_ITEMNAME, ifFunc, editMode));
            TextItem absoluteValue = new TextItem(THRESHOLD_ABSVALUE_ITEMNAME,
                MSG.view_alert_definition_condition_editor_metric_threshold_value());
            absoluteValue.setWrapTitle(false);
            absoluteValue.setRequired(true);
            absoluteValue.setTooltip(MSG.view_alert_definition_condition_editor_metric_threshold_value_tooltip());
            absoluteValue.setHoverWidth(200);
            absoluteValue.setValidateOnChange(true);
            absoluteValue.setValidators(new NumberWithUnitsValidator(this.resourceType.getMetricDefinitions(),
                metricDropDownMenu));
            if (editMode) {
                MeasurementUnits units = existingCondition.getMeasurementDefinition().getUnits();
                double doubleValue = existingCondition.getThreshold();
                MeasurementNumericValueAndUnits valueWithUnits = null;
                if (units.getFamily() == MeasurementUnits.Family.RELATIVE) {
                    valueWithUnits = new MeasurementNumericValueAndUnits(doubleValue * 100, MeasurementUnits.PERCENTAGE);
                } else {
                    valueWithUnits = MeasurementConverterClient.fit(doubleValue, units);
                }
                absoluteValue.setDefaultValue(valueWithUnits.toString());
            }
            absoluteValue.setShowIfCondition(ifFunc);
            formItems.add(absoluteValue);
            formItems.add(buildBaseUnitsItem(metricDropDownMenu, ifFunc, editMode));
        } else {
            String noMetricsStr = MSG.view_alert_definition_condition_editor_metric_nometrics();
            StaticTextItem noMetrics = buildHelpTextItem(THRESHOLD_NO_METRICS_ITEMNAME, noMetricsStr, ifFunc);
            formItems.add(noMetrics);
        }

        return formItems;
    }
View Full Code Here

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

        ArrayList<FormItem> formItems = new ArrayList<FormItem>();

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.RANGE);

        String helpStr = MSG.view_alert_definition_condition_editor_metric_range_tooltip();
        StaticTextItem helpItem = buildHelpTextItem("rangeHelp", helpStr, ifFunc);
        formItems.add(helpItem);

        SelectItem metricDropDownMenu = buildMetricDropDownMenu(RANGE_METRIC_ITEMNAME, false, ifFunc, editMode);
        if (metricDropDownMenu != null) {
            formItems.add(metricDropDownMenu);
            formItems.add(buildRangeComparatorDropDownMenu(RANGE_COMPARATOR_ITEMNAME, ifFunc, editMode));
            TextItem absoluteLowValue = new TextItem(RANGE_LO_ABSVALUE_ITEMNAME,
                MSG.view_alert_definition_condition_editor_metric_range_lovalue());
            absoluteLowValue.setWrapTitle(false);
            absoluteLowValue.setRequired(true);
            absoluteLowValue.setTooltip(MSG.view_alert_definition_condition_editor_metric_range_lovalue_tooltip());
            absoluteLowValue.setHoverWidth(200);
            absoluteLowValue.setValidateOnChange(true);
            absoluteLowValue.setValidators(new NumberWithUnitsValidator(this.resourceType.getMetricDefinitions(),
                metricDropDownMenu));
            absoluteLowValue.setShowIfCondition(ifFunc);

            TextItem absoluteHighValue = new TextItem(RANGE_HI_ABSVALUE_ITEMNAME,
                MSG.view_alert_definition_condition_editor_metric_range_hivalue());
            absoluteHighValue.setWrapTitle(false);
            absoluteHighValue.setRequired(true);
            absoluteHighValue.setTooltip(MSG.view_alert_definition_condition_editor_metric_range_hivalue_tooltip());
            absoluteHighValue.setHoverWidth(200);
            absoluteHighValue.setValidateOnChange(true);
            absoluteHighValue.setValidators(new NumberWithUnitsValidator(this.resourceType.getMetricDefinitions(),
                metricDropDownMenu));
            absoluteHighValue.setShowIfCondition(ifFunc);
            if (editMode) {
                absoluteLowValue.setDefaultValue(String.valueOf(existingCondition.getThreshold()));
                absoluteHighValue.setDefaultValue(String.valueOf(existingCondition.getOption()));
            }

            formItems.add(absoluteLowValue);
            formItems.add(absoluteHighValue);
            formItems.add(buildBaseUnitsItem(metricDropDownMenu, ifFunc, editMode));
        } else {
            String noMetricsStr = MSG.view_alert_definition_condition_editor_metric_nometrics();
            StaticTextItem noMetrics = buildHelpTextItem(RANGE_NO_METRICS_ITEMNAME, noMetricsStr, ifFunc);
            formItems.add(noMetrics);
        }

        return formItems;
    }
View Full Code Here

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

        ArrayList<FormItem> formItems = new ArrayList<FormItem>();

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.BASELINE);

        String helpStr = MSG.view_alert_definition_condition_editor_metric_baseline_tooltip();
        StaticTextItem helpItem = buildHelpTextItem("baselineHelp", helpStr, ifFunc);
        formItems.add(helpItem);

        // if a metric is trending (up or down), it will never have baselines calculated for it so only show dynamic metrics
        SelectItem metricDropDownMenu = buildMetricDropDownMenu(BASELINE_METRIC_ITEMNAME, true, ifFunc, editMode);
        if (metricDropDownMenu != null) {
            formItems.add(metricDropDownMenu);
            formItems.add(buildComparatorDropDownMenu(BASELINE_COMPARATOR_ITEMNAME, ifFunc, editMode));

            TextItem baselinePercentage = new TextItem(BASELINE_PERCENTAGE_ITEMNAME,
                MSG.view_alert_definition_condition_editor_metric_baseline_percentage());
            baselinePercentage.setWrapTitle(false);
            baselinePercentage.setRequired(true);
            baselinePercentage.setTooltip(MSG
                .view_alert_definition_condition_editor_metric_baseline_percentage_tooltip());
            baselinePercentage.setHoverWidth(200);
            baselinePercentage.setShowIfCondition(ifFunc);
            baselinePercentage.setValidateOnChange(true);
            baselinePercentage.setValidators(new NumberWithUnitsValidator(MeasurementUnits.PERCENTAGE));
            if (editMode) {
                baselinePercentage.setDefaultValue(String.valueOf((int) (existingCondition.getThreshold() * 100)));
            }
            formItems.add(baselinePercentage);

            SelectItem baselineSelection = new SelectItem(BASELINE_SELECTION_ITEMNAME,
                MSG.view_alert_definition_condition_editor_metric_baseline_value());
            LinkedHashMap<String, String> baselines = new LinkedHashMap<String, String>(3);
            baselines.put("min", MSG.common_title_monitor_minimum()); // TODO can we have the current value of the min baseline
            baselines.put("mean", MSG.common_title_monitor_average()); // TODO can we have the current value of the avg baseline
            baselines.put("max", MSG.common_title_monitor_maximum()); // TODO can we have the current value of the max baseline
            baselineSelection.setValueMap(baselines);
            baselineSelection.setDefaultValue(editMode ? existingCondition.getOption() : "mean");
            baselineSelection.setWrapTitle(false);
            baselineSelection.setWidth("*");
            baselineSelection.setRedrawOnChange(true);
            baselineSelection.setShowIfCondition(ifFunc);
            formItems.add(baselineSelection);
        } else {
            String noMetricsStr = MSG.view_alert_definition_condition_editor_metric_nometrics();
            StaticTextItem noMetrics = buildHelpTextItem(BASELINE_NO_METRICS_ITEMNAME, noMetricsStr, ifFunc);
            formItems.add(noMetrics);
        }

        return formItems;
    }
View Full Code Here

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

        ArrayList<FormItem> formItems = new ArrayList<FormItem>();

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.CHANGE);

        String helpStr = MSG.view_alert_definition_condition_editor_metric_change_tooltip();
        StaticTextItem helpItem = buildHelpTextItem("changeMetricHelp", helpStr, ifFunc);
        formItems.add(helpItem);

        SelectItem metricDropDownMenu = buildMetricDropDownMenu(CHANGE_METRIC_ITEMNAME, false, ifFunc, editMode);
        if (metricDropDownMenu != null) {
            formItems.add(metricDropDownMenu);
        } else {
            String noMetricsStr = MSG.view_alert_definition_condition_editor_metric_nometrics();
            StaticTextItem noMetrics = buildHelpTextItem(CHANGE_NO_METRICS_ITEMNAME, noMetricsStr, ifFunc);
            formItems.add(noMetrics);
        }

        return formItems;
    }
View Full Code Here

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

        ArrayList<FormItem> formItems = new ArrayList<FormItem>();

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(ALERT_CONDITION_CATEGORY_CALLTIME_THRESHOLD);

        String helpStr = MSG.view_alert_definition_condition_editor_metric_calltime_threshold_tooltip();
        StaticTextItem helpItem = buildHelpTextItem("calltimeThresholdHelp", helpStr, ifFunc);
        formItems.add(helpItem);

        SelectItem metricDropDownMenu = buildCalltimeMetricDropDownMenu(CALLTIME_THRESHOLD_METRIC_ITEMNAME, ifFunc,
            editMode);
        formItems.add(metricDropDownMenu);
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.