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

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


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


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

        public void onKeyPress(KeyPressEvent event) {
            if (event.getKeyName().equals("Enter")) {

                if (null != searchBarItem) {
                    if (searchBarItem.getSearchBar().isFilterEnabled()) {
                        TextItem searchTextItem = searchBarItem.getSearchBar().getSearchTextItem();
                        String searchBarValue = searchTextItem.getValueAsString();
                        String hiddenValue = (String) hiddenItem.getValue();

                        // Only send a fetch request if the user actually changed the search expression.
                        if (!equals(searchBarValue, hiddenValue)) {
                            hiddenItem.setValue(searchBarValue);
View Full Code Here

        alertFilter.setValues(null);

        startDateFilter = new DateFilterItem(DateFilterItem.START_DATE_FILTER, MSG.filter_from_date());
        endDateFilter = new DateFilterItem(DateFilterItem.END_DATE_FILTER, MSG.filter_to_date());

        alertNameFilter = new TextItem(AlertDataSource.FILTER_NAME, MSG.common_title_name());
        alertNameFilter.setWrapTitle(false);
        alertNameFilter.setValue("");
        PickerIcon refreshFilter = new PickerIcon(PickerIcon.CLEAR, new FormItemClickHandler() {
            public void onFormItemClick(FormItemIconClickEvent event) {
                alertNameFilter.clearValue();
View Full Code Here

        final SelectItem unitsMenu = new SelectItem("unitsItem", "Units");
        unitsMenu.setValueMap(unitsChoices);
        unitsMenu.setDefaultValue(MeasurementUnits.BYTES.name());

        final TextItem textItem = new TextItem("valueItem", "Value");

        final StaticTextItem resultsValueItem = new StaticTextItem("resultsValue", "Results Value");
        final StaticTextItem resultsUnitItem = new StaticTextItem("resultsUnits", "Results Units");

        ButtonItem button = new ButtonItem("convertItem", "Convert");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                MeasurementUnits units = MeasurementUnits.valueOf(unitsMenu.getValueAsString());
                String value = textItem.getValueAsString();
                MeasurementNumericValueAndUnits vu = MeasurementParser.parse(value, units);
                resultsValueItem.setValue(vu.getValue().toString());
                resultsUnitItem.setValue(vu.getUnits().name());
            }
        });
View Full Code Here

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

        minMaxAvgSelection.setRedrawOnChange(true);
        minMaxAvgSelection.setShowIfCondition(ifFunc);
        formItems.add(minMaxAvgSelection);

        formItems.add(buildComparatorDropDownMenu(CALLTIME_THRESHOLD_COMPARATOR_ITEMNAME, ifFunc, editMode));
        TextItem absoluteValue = new TextItem(CALLTIME_THRESHOLD_ABSVALUE_ITEMNAME,
            MSG.view_alert_definition_condition_editor_metric_calltime_threshold_value());
        absoluteValue.setWrapTitle(false);
        absoluteValue.setRequired(true);
        absoluteValue.setTooltip(MSG.view_alert_definition_condition_editor_metric_calltime_threshold_value_tooltip());
        absoluteValue.setHoverWidth(200);
        absoluteValue.setShowIfCondition(ifFunc);
        absoluteValue.setValidateOnChange(true);
        absoluteValue.setValidators(new NumberWithUnitsValidator(this.resourceType.getMetricDefinitions(),
            metricDropDownMenu));

        TextItem regex = new TextItem(CALLTIME_THRESHOLD_REGEX_ITEMNAME,
            MSG.view_alert_definition_condition_editor_common_regex());
        regex.setRequired(false);
        regex.setTooltip(MSG.view_alert_definition_condition_editor_metric_calltime_regexTooltip());
        regex.setHoverWidth(200);
        regex.setWrapTitle(false);
        regex.setShowIfCondition(ifFunc);
        if (editMode) {
            absoluteValue.setDefaultValue(String.valueOf(existingCondition.getThreshold()));
            regex.setDefaultValue(existingCondition.getName());
        }

        formItems.add(absoluteValue);
        formItems.add(regex);
        return formItems;
View Full Code Here

        minMaxAvgSelection.setShowIfCondition(ifFunc);
        formItems.add(minMaxAvgSelection);

        formItems.add(buildCalltimeComparatorDropDownMenu(CALLTIME_CHANGE_COMPARATOR_ITEMNAME, ifFunc, editMode));

        TextItem percentage = new TextItem(CALLTIME_CHANGE_PERCENTAGE_ITEMNAME,
            MSG.view_alert_definition_condition_editor_metric_calltime_change_percentage());
        percentage.setWrapTitle(false);
        percentage.setRequired(true);
        percentage.setTooltip(MSG.view_alert_definition_condition_editor_metric_calltime_change_percentage_tooltip());
        percentage.setHoverWidth(200);
        percentage.setShowIfCondition(ifFunc);
        percentage.setValidateOnChange(true);
        percentage.setValidators(new NumberWithUnitsValidator(MeasurementUnits.PERCENTAGE));

        TextItem regex = new TextItem(CALLTIME_CHANGE_REGEX_ITEMNAME,
            MSG.view_alert_definition_condition_editor_common_regex());
        regex.setRequired(false);
        regex.setTooltip(MSG.view_alert_definition_condition_editor_metric_calltime_regexTooltip());
        regex.setHoverWidth(200);
        regex.setWrapTitle(false);
        regex.setShowIfCondition(ifFunc);
        if (editMode) {
            percentage.setDefaultValue(String.valueOf((int) (existingCondition.getThreshold() * 100)));
            regex.setDefaultValue(existingCondition.getName());
        }

        formItems.add(percentage);
        formItems.add(regex);
        return formItems;
View Full Code Here

        traitSelection.setWidth("*");
        traitSelection.setRedrawOnChange(true);
        traitSelection.setShowIfCondition(ifFunc);
        formItems.add(traitSelection);

        TextItem eventRegex = new TextItem(TRAIT_REGEX_ITEMNAME,
            MSG.view_alert_definition_condition_editor_common_regex());
        eventRegex.setRequired(false);
        eventRegex.setTooltip(MSG.view_alert_definition_condition_editor_metric_trait_regexTooltip());
        eventRegex.setHoverWidth(200);
        eventRegex.setWrapTitle(false);
        eventRegex.setShowIfCondition(ifFunc);
        if (editMode) {
            eventRegex.setDefaultValue(existingCondition.getOption());
        }
        formItems.add(eventRegex);

        return formItems;
    }
View Full Code Here

            } else {
                eventRegexValue = existingCondition.getOption(); // old approach -> probably working with db before rhq 4.13
            }
        }

        TextItem eventDetailsRegex = new TextItem(EVENT_REGEX_ITEMNAME,
            MSG.view_alert_definition_condition_editor_common_regex());
        eventDetailsRegex.setRequired(false);
        eventDetailsRegex.setTooltip(MSG.view_alert_definition_condition_editor_event_regexTooltip());
        eventDetailsRegex.setHoverWidth(200);
        eventDetailsRegex.setWrapTitle(false);
        eventDetailsRegex.setShowIfCondition(ifFunc);
        if (editMode) {
            eventDetailsRegex.setDefaultValue(eventRegexValue);
        }
        formItems.add(eventDetailsRegex);
       
        TextItem eventSourcePathRegex = new TextItem(EVENT_SOURCE_PATH_REGEX_ITEMNAME,
            MSG.view_inventory_eventHistory_sourceLocation() + " "
                + MSG.view_alert_definition_condition_editor_common_regex());
        eventSourcePathRegex.setRequired(false);
        eventSourcePathRegex.setTooltip(MSG.view_alert_definition_condition_editor_common_regex_tooltip());
        eventSourcePathRegex.setHoverWidth(200);
        eventSourcePathRegex.setWrapTitle(false);
        eventSourcePathRegex.setShowIfCondition(ifFunc);
        if (editMode) {
            eventSourcePathRegex.setDefaultValue(eventSourcePathRegexValue);
        }
        formItems.add(eventSourcePathRegex);

        return formItems;
    }
View Full Code Here

TOP

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

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.