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

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


                enableDisableComponents();
                buildExpressionValue();
            }
        });

        this.propertyNameItem = new SelectItem("propertyName", MSG.view_dynagroup_exprBuilder_propertyName());
        this.propertyNameItem.setTooltip(MSG.view_dynagroup_exprBuilder_propertyName_tooltip());
        this.propertyNameItem.setHoverWidth(250);
        this.propertyNameItem.setRedrawOnChange(true);
        this.propertyNameItem.setWidth("*");
        this.propertyNameItem.setDefaultToFirstOption(true);
View Full Code Here


                });
                formItems.add(versionItem);
            }

            if (null != architecturePrompt) {
                selectArchItem = new SelectItem("selectArch", architecturePrompt);
                selectArchItem.setRequired(true);
                selectArchItem.disable();
                selectArchItem.setTitleOrientation(TitleOrientation.TOP);
                selectArchItem.setAlign(Alignment.LEFT);
                selectArchItem.setWidth(300);
                setSelectArchItemValues();

                selectArchItem.addChangedHandler(new ChangedHandler() {
                    public void onChanged(ChangedEvent event) {
                        Object value = event.getValue();
                        if (value != null) {
                            wizard.setNewResourceArchitectureId((Integer) value);
                        }
                    }
                });
                formItems.add(selectArchItem);
            }

            if (null != templatePrompt) {
                SelectItem templateSelect = new SortedSelectItem("template", templatePrompt);
                templateSelect.setTitleOrientation(TitleOrientation.TOP);
                templateSelect.setAlign(Alignment.LEFT);
                templateSelect.setWidth(300);

                if (templates != null && templates.size() > 1) {
                    templateSelect.setValueMap(templates.keySet().toArray(new String[templates.size()]));
                    templateSelect.setValue("default");
                    wizard.setNewResourceStartingConfiguration(templates.get("default").createConfiguration());
                    templateSelect.addChangedHandler(new ChangedHandler() {
                        public void onChanged(ChangedEvent event) {
                            Object value = event.getValue();
                            if (value == null) {
                                value = "";
                            }
                            wizard.setNewResourceStartingConfiguration(templates.get(value).createConfiguration());
                        }
                    });
                } else {
                    templateSelect.setVisible(false);
                }

                formItems.add(templateSelect);
            }
View Full Code Here

        } else {
            enableScheduledOperationsGrouping.setValue(true);
        }

        //------------- Build second combobox for timeframe for problem resources search.
        final SelectItem maximumScheduledOperationsComboBox = new SelectItem(OPERATIONS_RANGE_SCHEDULED);
        maximumScheduledOperationsComboBox.setTitle("");
        maximumScheduledOperationsComboBox.setHint("<nobr><b> " + MSG.common_label_scheduled_operations()
            + ".</b></nobr>");
        maximumScheduledOperationsComboBox.setType("selection");
        //define acceptable values for display amount
        String[] acceptableDisplayValues = { "1", "5", "10", "15", unlimitedString };
        maximumScheduledOperationsComboBox.setValueMap(acceptableDisplayValues);
        maximumScheduledOperationsComboBox.setWidth(100);
        maximumScheduledOperationsComboBox.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                String selectedItem = "" + event.getValue();
                //stuff into the master form for retrieval
                form.setValue(OPERATIONS_RANGE_SCHEDULED, selectedItem);
            }
        });

        String retrieved = defaultValue;

        if ((property = storedPortlet.getConfiguration().getSimple(OPERATIONS_RANGE_SCHEDULED)) != null) {
            retrieved = property.getStringValue();
            // protect against legacy issue with non-numeric values
            try {
                Integer.parseInt(retrieved);
            } catch (NumberFormatException e) {
                retrieved = unlimited;
            }
        }

        //prepopulate the combobox with the previously stored selection
        String selectedValue = retrieved.equals(unlimited) ? unlimitedString : retrieved;

        //prepopulate the combobox with the previously stored selection
        maximumScheduledOperationsComboBox.setDefaultValue(selectedValue);
        DynamicForm fieldWrapper2 = new DynamicForm();
        fieldWrapper2.setFields(maximumScheduledOperationsComboBox);
        sheduledOperationsLayout.addMember(fieldWrapper2);
        column.addMember(sheduledOperationsLayout);
        form.addChild(column);
View Full Code Here

        final DynamicForm form = new DynamicForm();

        final DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();

        // combobox for number of recently added resources to display on the dashboard
        final SelectItem maximumRecentlyAddedComboBox = new SelectItem(RECENTLY_ADDED_SHOW_MAX);
        maximumRecentlyAddedComboBox.setTitle(MSG.common_title_show());
        maximumRecentlyAddedComboBox.setHint("<nobr><b> " + MSG.view_portlet_recentlyAdded_setting_addedPlatforms()
            + "</b></nobr>");
        //spinder 9/3/10: the following is required workaround to disable editability of combobox.
        maximumRecentlyAddedComboBox.setType("selection");
        //define acceptable values for display amount
        String[] acceptableDisplayValues = { "5", "10", "15", "20", "30", unlimitedString };
        maximumRecentlyAddedComboBox.setValueMap(acceptableDisplayValues);
        //set width of dropdown display region
        maximumRecentlyAddedComboBox.setWidth(100);

        int configuredValue = populateConfigurationValue(storedPortlet, RECENTLY_ADDED_SHOW_MAX, defaultValue);
        String selectedValue = configuredValue == unlimited ? unlimitedString : String.valueOf(configuredValue);

        //prepopulate the combobox with the previously stored selection
        maximumRecentlyAddedComboBox.setDefaultValue(selectedValue);

        // second combobox for timeframe for problem resources search.
        final SelectItem maximumTimeRecentlyAddedComboBox = new SelectItem(RECENTLY_ADDED_SHOW_HRS);
        maximumTimeRecentlyAddedComboBox.setTitle("Over ");
        maximumTimeRecentlyAddedComboBox.setHint("<nobr><b> " + MSG.common_unit_hours() + " </b></nobr>");
        //spinder 9/3/10: the following is required workaround to disable editability of combobox.
        maximumTimeRecentlyAddedComboBox.setType("selection");
        //define acceptable values for display amount
        String[] acceptableTimeValues = { "1", "4", "8", "24", "48", unlimitedString };
        maximumTimeRecentlyAddedComboBox.setValueMap(acceptableTimeValues);
        maximumTimeRecentlyAddedComboBox.setWidth(100);

        configuredValue = populateConfigurationValue(storedPortlet, RECENTLY_ADDED_SHOW_HRS, defaultValue);
        selectedValue = configuredValue == unlimited ? unlimitedString : String.valueOf(configuredValue);

        //prepopulate the combobox with the previously stored selection
        maximumTimeRecentlyAddedComboBox.setDefaultValue(selectedValue);

        // insert fields
        form.setFields(maximumRecentlyAddedComboBox, maximumTimeRecentlyAddedComboBox);

        // submit handler
View Full Code Here

        // event source
        final TextItem eventSourceFilter = PortletConfigurationEditorComponent.getEventSourceEditor(portletConfig);
        items.add(eventSourceFilter);
       
        // event severity
        final SelectItem eventSeveritySelector = PortletConfigurationEditorComponent
            .getEventSeverityEditor(portletConfig);
        items.add(eventSeveritySelector);

        // result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
        items.add(resultCountSelector);

        // range selector
        final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
            .getMeasurementRangeEditor(portletConfig);
       
        filterForm.setItems(items.toArray(new FormItem[items.size()]));

        //submit handler
        customSettingsForm.addSubmitValuesHandler(new SubmitValuesHandler() {

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                // resource name
                if (eventResourceFilter != null) {
                    String selectedValue = (null == eventResourceFilter.getValue()) ? "" : eventResourceFilter.getValue()
                        .toString();
                    portletConfig.put(new PropertySimple(Constant.EVENT_RESOURCE, selectedValue));
                }
               
                // event source
                String selectedValue = (null == eventSourceFilter.getValue()) ? "" : eventSourceFilter.getValue()
                    .toString();
                portletConfig.put(new PropertySimple(Constant.EVENT_SOURCE, selectedValue));
               
                // event severity
                selectedValue = (null == eventSeveritySelector.getValue()) ? "" : eventSeveritySelector
                    .getValue().toString();
                if ((selectedValue.trim().isEmpty())
                    || (selectedValue.split(",").length == EventSeverity.values().length)) {
                    // no severity filter
                    selectedValue = Constant.EVENT_SEVERITY_DEFAULT;
                }
                portletConfig.put(new PropertySimple(Constant.EVENT_SEVERITY, selectedValue));

                // result count
                selectedValue = resultCountSelector.getValue().toString();
                if (selectedValue.trim().isEmpty()) {
                    selectedValue = Constant.RESULT_COUNT_DEFAULT;
                }
                portletConfig.put(new PropertySimple(Constant.RESULT_COUNT, selectedValue));
View Full Code Here

        final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
        final Configuration portletConfig = storedPortlet.getConfiguration();

        // operation history status selector
        final SelectItem operationStatusSelector = PortletConfigurationEditorComponent
            .getOperationStatusEditor(portletConfig);

        // result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);

        // range selector
        final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
            .getMeasurementRangeEditor(portletConfig);

        filterForm.setItems(operationStatusSelector, resultCountSelector);

        //submit handler
        customSettingsForm.addSubmitValuesHandler(new SubmitValuesHandler() {

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                // operation status
                String selectedValue = (null == operationStatusSelector.getValue()) ? "" : operationStatusSelector
                    .getValue().toString();
                if ((selectedValue.trim().isEmpty())
                    || (selectedValue.split(",").length == OperationRequestStatus.values().length)) {
                    selectedValue = Constant.OPERATION_STATUS_DEFAULT;
                }
                portletConfig.put(new PropertySimple(Constant.OPERATION_STATUS, selectedValue));

                // result count
                selectedValue = resultCountSelector.getValue().toString();
                if (selectedValue.trim().isEmpty()) {
                    selectedValue = Constant.RESULT_COUNT_DEFAULT;
                }
                portletConfig.put(new PropertySimple(Constant.RESULT_COUNT, selectedValue));
View Full Code Here

        EnhancedVLayout page = new EnhancedVLayout();
        //build editor form container
        final DynamicForm form = new DynamicForm();
        form.setMargin(5);
        //add result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
        form.setItems(resultCountSelector);

        //submit handler
        customSettings.addSubmitValuesHandler(new SubmitValuesHandler() {
View Full Code Here

        // alert name filter
        final TextItem alertNameFilter = PortletConfigurationEditorComponent.getAlertNameEditor(portletConfig);
       
        // alert priority selector
        final SelectItem alertPrioritySelector = PortletConfigurationEditorComponent
            .getAlertPriorityEditor(portletConfig);

        // result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);

        // range selector
        final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
            .getMeasurementRangeEditor(portletConfig);

        // "Filter acknowledged", "Filter recovery alerts", "Filter recovered" - drop down
        final SelectItem filterSelector = PortletConfigurationEditorComponent.getAlertFilterEditor(portletConfig);

        filterForm.setItems(alertNameFilter, alertPrioritySelector, resultCountSelector, filterSelector);

        //submit handler
        customSettingsForm.addSubmitValuesHandler(new SubmitValuesHandler() {

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                // alert name
                String selectedValue = (null == alertNameFilter.getValue()) ? "" : alertNameFilter.getValue()
                    .toString();
                portletConfig.put(new PropertySimple(Constant.ALERT_NAME, selectedValue));
               
                // alert severity
                selectedValue = (null == alertPrioritySelector.getValue()) ? "" : alertPrioritySelector
                    .getValue().toString();
                if ((selectedValue.trim().isEmpty())
                    || (selectedValue.split(",").length == AlertPriority.values().length)) {
                    // no severity filter
                    selectedValue = Constant.ALERT_PRIORITY_DEFAULT;
                }
                portletConfig.put(new PropertySimple(Constant.ALERT_PRIORITY, selectedValue));

                // result count
                selectedValue = resultCountSelector.getValue().toString();
                if (selectedValue.trim().isEmpty()) {
                    selectedValue = Constant.RESULT_COUNT_DEFAULT;
                }
                portletConfig.put(new PropertySimple(Constant.RESULT_COUNT, selectedValue));

                // time range settings
                saveMeasurementRangeEditorSettings(measurementRangeEditor, portletConfig);

                // filter settings
                if(filterSelector.getValue() == null) {
                    selectedValue = Constant.ALERT_FILTER_DEFAULT;
                } else {
                    selectedValue = filterSelector.getValue().toString();
                }
                portletConfig.put(new PropertySimple(Constant.ALERT_FILTER, selectedValue));

                // persist and reload portlet
                storedPortlet.setConfiguration(portletConfig);
View Full Code Here

        final DynamicForm form = new DynamicForm();

        final DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();

        //-------------combobox for number of resource to display on the dashboard
        final SelectItem maximumProblemResourcesComboBox = new SelectItem(PROBLEM_RESOURCE_SHOW_MAX);
        maximumProblemResourcesComboBox.setTitle(MSG.common_title_display());
        maximumProblemResourcesComboBox.setHint("<nobr><b> " + MSG.view_portlet_problemResources_maxDisplaySetting()
            + "</b></nobr>");
        //spinder 9/3/10: the following is required workaround to disable editability of combobox.
        maximumProblemResourcesComboBox.setType("selection");
        //define acceptable values for display amount
        String[] acceptableDisplayValues = { "5", "10", "15", "20", "30", unlimitedString };
        maximumProblemResourcesComboBox.setValueMap(acceptableDisplayValues);
        //set width of dropdown display region
        maximumProblemResourcesComboBox.setWidth(100);

        int configuredValue = populateConfigurationValue(storedPortlet, PROBLEM_RESOURCE_SHOW_MAX, defaultShowMax);
        String selectedValue = configuredValue == unlimited ? unlimitedString : String.valueOf(configuredValue);

        //prepopulate the combobox with the previously stored selection
        maximumProblemResourcesComboBox.setDefaultValue(selectedValue);

        //------------- Build second combobox for timeframe for problem resources search.
        final SelectItem maximumTimeProblemResourcesComboBox = new SelectItem(PROBLEM_RESOURCE_SHOW_HRS);
        maximumTimeProblemResourcesComboBox.setTitle(MSG.common_title_over() + " ");
        maximumTimeProblemResourcesComboBox.setHint("<nobr><b> " + MSG.common_unit_hours() + " </b></nobr>");
        //spinder 9/3/10: the following is required workaround to disable editability of combobox.
        maximumTimeProblemResourcesComboBox.setType("selection");
        String[] acceptableTimeValues = { "1", "4", "8", "24", "48", unlimitedString };
        maximumTimeProblemResourcesComboBox.setValueMap(acceptableTimeValues);
        maximumTimeProblemResourcesComboBox.setWidth(100);

        configuredValue = populateConfigurationValue(storedPortlet, PROBLEM_RESOURCE_SHOW_HRS, defaultShowHours);
        selectedValue = configuredValue == unlimited ? unlimitedString : String.valueOf(configuredValue);

        //prepopulate the combobox with the previously stored selection
        maximumTimeProblemResourcesComboBox.setDefaultValue(selectedValue);

        //insert fields
        form.setFields(maximumProblemResourcesComboBox, maximumTimeProblemResourcesComboBox);

        //submit handler
View Full Code Here

        EnhancedVLayout page = new EnhancedVLayout();
        //build editor form container
        final DynamicForm form = new DynamicForm();
        form.setMargin(5);
        //add result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
        form.setItems(resultCountSelector);

        //submit handler
        customSettings.addSubmitValuesHandler(new SubmitValuesHandler() {
View Full Code Here

TOP

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

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.