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

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


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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(ALERT_CONDITION_CATEGORY_CALLTIME_CHANGE);

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

        formItems.add(buildCalltimeMetricDropDownMenu(CALLTIME_CHANGE_METRIC_ITEMNAME, ifFunc, editMode));

        SelectItem minMaxAvgSelection = new SelectItem(CALLTIME_CHANGE_MINMAXAVG_ITEMNAME,
View Full Code Here


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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.TRAIT);

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

        LinkedHashMap<String, String> traitsMap = new LinkedHashMap<String, String>();
        for (MeasurementDefinition def : this.resourceType.getMetricDefinitions()) {
            if (def.getDataType() == DataType.TRAIT) {
View Full Code Here

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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.AVAILABILITY);

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

        SelectItem selection = new SortedSelectItem(AVAILABILITY_ITEMNAME, MSG.common_title_availability());
        LinkedHashMap<String, String> avails = new LinkedHashMap<String, String>(2);
        avails.put(AlertConditionOperator.AVAIL_GOES_DOWN.name(),
View Full Code Here

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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.AVAIL_DURATION);

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

        SelectItem selection = new SortedSelectItem(AVAILABILITY_DURATION_ITEMNAME,
            MSG.view_alert_definition_condition_editor_availabilityDuration_state());
        LinkedHashMap<String, String> avails = new LinkedHashMap<String, String>(2);
View Full Code Here

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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.CONTROL);

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

        LinkedHashMap<String, String> ops = new LinkedHashMap<String, String>();
        for (OperationDefinition opDef : this.resourceType.getOperationDefinitions()) {
            ops.put(opDef.getName(), opDef.getDisplayName());
View Full Code Here

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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.EVENT);

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

        SelectItem eventSeveritySelection = new SelectItem(EVENT_SEVERITY_ITEMNAME,
            MSG.view_alert_definition_condition_editor_event_severity());
        LinkedHashMap<String, String> severities = new LinkedHashMap<String, String>(5);
View Full Code Here

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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.RESOURCE_CONFIG);

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

        return formItems;
    }
View Full Code Here

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

        ShowIfCategoryFunction ifFunc = new ShowIfCategoryFunction(AlertConditionCategory.DRIFT);

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

        TextItem driftDefNameRegex = new TextItem(DRIFT_DEFNAME_REGEX_ITEMNAME,
            MSG.view_alert_definition_condition_editor_drift_configname_regex());
        driftDefNameRegex.setRequired(false);
View Full Code Here

    }

    private StaticTextItem buildBaseUnitsItem(final SelectItem metricDropDownMenu, FormItemIfFunction ifFunc,
        boolean editMode) {
        String baseUnits = MSG.view_alert_definition_condition_editor_common_baseUnits();
        final StaticTextItem baseUnitsItem = new StaticTextItem("baseUnits", baseUnits);
        baseUnitsItem.setHoverWidth(200);
        baseUnitsItem.setShowIfCondition(ifFunc);

        metricDropDownMenu.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                MeasurementDefinition measDef = getMeasurementDefinition(metricDropDownMenu.getValueAsString());
                baseUnitsItem.setValue(measDef.getUnits() == MeasurementUnits.NONE ? MSG
                    .view_alert_definition_condition_editor_common_baseUnits_none() : measDef.getUnits().toString());
                List<MeasurementUnits> availableUnits = measDef.getUnits().getFamilyUnits();
                baseUnitsItem.setTooltip(MSG.view_alert_definition_condition_editor_common_baseUnits_availableUnits()
                    + (availableUnits.isEmpty() || availableUnits.get(0) == MeasurementUnits.NONE ? MSG
                        .view_alert_definition_condition_editor_common_baseUnits_none() : availableUnits));
            }
        });
        // initialize the field, the default will be the first entry in the value map
        MeasurementDefinition defaultMeasDef = getMeasurementDefinition((String) metricDropDownMenu
            .getAttributeAsMap("valueMap").keySet().iterator().next());
        MeasurementUnits units = defaultMeasDef.getUnits();
        baseUnitsItem.setValue(units == MeasurementUnits.NONE ? MSG
            .view_alert_definition_condition_editor_common_baseUnits_none() : units.toString());
        List<MeasurementUnits> availableUnits = units.getFamilyUnits();
        baseUnitsItem.setTooltip(MSG.view_alert_definition_condition_editor_common_baseUnits_availableUnits()
            + (availableUnits.isEmpty() || availableUnits.get(0) == MeasurementUnits.NONE ? MSG
                .view_alert_definition_condition_editor_common_baseUnits_none() : availableUnits));
        return baseUnitsItem;
    }
View Full Code Here

                .view_alert_definition_condition_editor_common_baseUnits_none() : availableUnits));
        return baseUnitsItem;
    }

    private StaticTextItem buildHelpTextItem(String itemName, String helpText, FormItemIfFunction ifFunc) {
        StaticTextItem help = new StaticTextItem(itemName);
        help.setShowTitle(false);
        help.setColSpan(2);
        help.setRowSpan(2);
        help.setWrap(true);
        help.setValue(helpText);
        help.setShowIfCondition(ifFunc);
        return help;
    }
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.