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

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


        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


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

        // drift category selector
        SelectItem categoryFilter = new SelectItem("Category", MSG.common_title_category());
        categoryFilter.setWrapTitle(false);
        categoryFilter.setWidth(200);
        categoryFilter.setMultiple(true);
        categoryFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);

        LinkedHashMap<String, String> categories = new LinkedHashMap<String, String>(3);
        categories.put(DriftCategory.FILE_ADDED.name(), MSG.view_drift_category_fileAdded());
        categories.put(DriftCategory.FILE_CHANGED.name(), MSG.view_drift_category_fileChanged());
        categories.put(DriftCategory.FILE_REMOVED.name(), MSG.view_drift_category_fileRemoved());
        //TODO icons?
        /*
        LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
        priorityIcons.put(AlertPriority.HIGH.name(), ImageManager.getAlertIcon(AlertPriority.HIGH));
        priorityIcons.put(AlertPriority.MEDIUM.name(), ImageManager.getAlertIcon(AlertPriority.MEDIUM));
        priorityIcons.put(AlertPriority.LOW.name(), ImageManager.getAlertIcon(AlertPriority.LOW));
        */
        categoryFilter.setValueMap(categories);
        //categoryFilter.setValueIcons(priorityIcons);
        //reload current settings if they exist, otherwise enable all.
        String currentValue = portletConfig.getSimple(DRIFT_CATEGORY).getStringValue();
        if (currentValue.isEmpty() || currentValue.split(",").length == DriftCategory.values().length) {
            categoryFilter.setValues(DriftCategory.names());
        } else {
            //spinder:3/4/11 doing this nonsense due to some weird smartgwt issue with SelectItem in VLayout.
            if (currentValue.equalsIgnoreCase(DriftCategory.FILE_ADDED.name())) {
                categoryFilter.setValues(DriftCategory.FILE_ADDED.name());
            } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_CHANGED.name())) {
                categoryFilter.setValues(DriftCategory.FILE_CHANGED.name());
            } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_REMOVED.name())) {
                categoryFilter.setValues(DriftCategory.FILE_REMOVED.name());
            } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_ADDED.name() + ","
                + DriftCategory.FILE_CHANGED.name())) {
                categoryFilter.setValues(DriftCategory.FILE_ADDED.name(), DriftCategory.FILE_CHANGED.name());
            } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_ADDED.name() + ","
                + DriftCategory.FILE_REMOVED.name())) {
                categoryFilter.setValues(DriftCategory.FILE_ADDED.name(), DriftCategory.FILE_REMOVED.name());
            } else {
                categoryFilter.setValues(DriftCategory.FILE_CHANGED.name(), DriftCategory.FILE_REMOVED.name());
            }
        }

        final SelectItem driftCategorySelector = categoryFilter;

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

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

        filterForm.setItems(driftCategorySelector, resultCountSelector);

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

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                // category
                String selectedValue = driftCategorySelector.getValue().toString();
                if ((selectedValue.trim().isEmpty())
                    || (selectedValue.split(",").length == DriftCategory.values().length)) {
                    // no severity filter
                    selectedValue = Constant.ALERT_PRIORITY_DEFAULT;
                }
                portletConfig.put(new PropertySimple(DRIFT_CATEGORY, 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

     *
     * @return Populated selectItem instance.
     */
    public static SelectItem getResultCountEditor(Configuration portletConfig) {

        final SelectItem maximumResultsComboBox = new SelectItem(Constant.RESULT_COUNT);
        maximumResultsComboBox.setTitle(MSG.common_title_results_count());
        maximumResultsComboBox.setWrapTitle(false);
        maximumResultsComboBox.setTooltip("<nobr><b> " + MSG.common_title_results_count_tooltip() + "</b></nobr>");
        //spinder 9/3/10: the following is required workaround to disable editability of combobox.
        maximumResultsComboBox.setType("selection");
        //set width of dropdown display region
        maximumResultsComboBox.setWidth(100);

        //TODO: spinder 3/4/11 this is arbitrary. Get UXD input for better acceptable defaults
        int[] selectionValues = { 5, 10, 30, 100 };

        //define acceptable values for display amount
        String[] displayValues = new String[selectionValues.length];
        int i = 0;
        for (int selection : selectionValues) {
            displayValues[i++] = String.valueOf(selection);
        }
        maximumResultsComboBox.setValueMap(displayValues);
        //reload current settings if they exist, otherwise enable all.
        String currentValue = portletConfig.getSimpleValue(Constant.RESULT_COUNT, Constant.RESULT_COUNT_DEFAULT);
        if (currentValue.isEmpty()) {
            maximumResultsComboBox.setValue(Constant.RESULT_COUNT_DEFAULT);
        } else {
            maximumResultsComboBox.setValue(currentValue);
        }
        return maximumResultsComboBox;
    }
View Full Code Here

    /* Multiple select combobox for alert priorities to display on dashboard
     *
     * @return Populated selectItem instance.
     */
    public static SelectItem getAlertPriorityEditor(Configuration portletConfig) {
        SelectItem priorityFilter = new SelectItem(Constant.ALERT_PRIORITY, MSG.view_alerts_table_filter_priority());
        priorityFilter.setWrapTitle(false);
        priorityFilter.setWidth(200);
        priorityFilter.setMultiple(true);
        priorityFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);

        LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(3);
        priorities.put(AlertPriority.HIGH.name(), MSG.common_alert_high());
        priorities.put(AlertPriority.MEDIUM.name(), MSG.common_alert_medium());
        priorities.put(AlertPriority.LOW.name(), MSG.common_alert_low());
        LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
        priorityIcons.put(AlertPriority.HIGH.name(), ImageManager.getAlertIcon(AlertPriority.HIGH));
        priorityIcons.put(AlertPriority.MEDIUM.name(), ImageManager.getAlertIcon(AlertPriority.MEDIUM));
        priorityIcons.put(AlertPriority.LOW.name(), ImageManager.getAlertIcon(AlertPriority.LOW));
        priorityFilter.setValueMap(priorities);
        priorityFilter.setValueIcons(priorityIcons);
        //reload current settings if they exist, otherwise enable all.
        String currentValue = portletConfig.getSimpleValue(Constant.ALERT_PRIORITY, Constant.ALERT_PRIORITY_DEFAULT);
        if (currentValue.trim().isEmpty() || currentValue.split(",").length == AlertPriority.values().length) {
            priorityFilter.setValues(AlertPriority.HIGH.name(), AlertPriority.MEDIUM.name(), AlertPriority.LOW.name());

        } else {
            //spinder:3/4/11 doing this nonsense due to some weird smartgwt issue with SelectItem in VLayout.
            if (currentValue.equalsIgnoreCase("HIGH")) {
                priorityFilter.setValues(AlertPriority.HIGH.name());
            } else if (currentValue.equalsIgnoreCase("HIGH,MEDIUM")) {
                priorityFilter.setValues(AlertPriority.HIGH.name(), AlertPriority.MEDIUM.name());
            } else if (currentValue.equalsIgnoreCase("HIGH,LOW")) {
                priorityFilter.setValues(AlertPriority.HIGH.name(), AlertPriority.LOW.name());
            } else if (currentValue.equalsIgnoreCase("MEDIUM")) {
                priorityFilter.setValues(AlertPriority.MEDIUM.name());
            } else if (currentValue.equalsIgnoreCase("MEDIUM,LOW")) {
                priorityFilter.setValues(AlertPriority.MEDIUM.name(), AlertPriority.LOW.name());
            } else {
                priorityFilter.setValues(AlertPriority.LOW.name());
            }
        }

        return priorityFilter;
    }
View Full Code Here

     * Multiple filter options, acknowledged, recovery alert, recovered

     * @return Populated selectItem instance
     */
    public static SelectItem getAlertFilterEditor(Configuration portletConfig) {
        SelectItem alertFilter = new SelectItem(Constant.ALERT_FILTER, MSG.view_alerts_table_filter_options());
        alertFilter.setWidth(325);
        alertFilter.setWrapTitle(false);
        alertFilter.setMultiple(true);
        alertFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);

        LinkedHashMap<String, String> filters = new LinkedHashMap<String, String>(3);
        filters.put(AlertFilter.ACKNOWLEDGED_STATUS.name(), MSG.common_alert_filter_acknowledged_status());
        filters.put(AlertFilter.RECOVERED_STATUS.name(), MSG.common_alert_filter_recovered_status());
        filters.put(AlertFilter.RECOVERY_TYPE.name(), MSG.common_alert_filter_recovery_type());
        alertFilter.setValueMap(filters);

        // Populate
        String currentValue = portletConfig.getSimpleValue(Constant.ALERT_FILTER, Constant.ALERT_FILTER_DEFAULT);
        alertFilter.setValues(currentValue);

        return alertFilter;
    }
View Full Code Here

    /* Multiple select combobox for event severities to display on dashboard
    *
    * @return Populated selectItem instance.
    */
   public static SelectItem getEventSeverityEditor(Configuration portletConfig) {
       SelectItem severityFilter = new SelectItem(Constant.EVENT_SEVERITY, MSG.view_inventory_eventHistory_severityFilter());
       severityFilter.setWrapTitle(false);
       severityFilter.setWidth(200);
       severityFilter.setMultiple(true);
       severityFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);

       LinkedHashMap<String, String> severities = new LinkedHashMap<String, String>(5);
       severities.put(EventSeverity.DEBUG.name(), MSG.common_severity_debug());
       severities.put(EventSeverity.INFO.name(), MSG.common_severity_info());
       severities.put(EventSeverity.WARN.name(), MSG.common_severity_warn());
       severities.put(EventSeverity.ERROR.name(), MSG.common_severity_error());
       severities.put(EventSeverity.FATAL.name(), MSG.common_severity_fatal());
       LinkedHashMap<String, String> severityIcons = new LinkedHashMap<String, String>(5);
       severityIcons.put(EventSeverity.DEBUG.name(), ImageManager.getEventSeverityIcon(EventSeverity.DEBUG));
       severityIcons.put(EventSeverity.INFO.name(), ImageManager.getEventSeverityIcon(EventSeverity.INFO));
       severityIcons.put(EventSeverity.WARN.name(), ImageManager.getEventSeverityIcon(EventSeverity.WARN));
       severityIcons.put(EventSeverity.ERROR.name(), ImageManager.getEventSeverityIcon(EventSeverity.ERROR));
       severityIcons.put(EventSeverity.FATAL.name(), ImageManager.getEventSeverityIcon(EventSeverity.FATAL));
       severityFilter.setValueMap(severities);
       severityFilter.setValueIcons(severityIcons);
       //reload current settings if they exist, otherwise enable all.
       String currentValue = portletConfig.getSimpleValue(Constant.EVENT_SEVERITY, Constant.EVENT_SEVERITY_DEFAULT);
       if (currentValue.trim().isEmpty() || currentValue.split(",").length == EventSeverity.values().length) {
            severityFilter.setValues(EventSeverity.DEBUG.name(), EventSeverity.INFO.name(), EventSeverity.WARN.name(),
                EventSeverity.ERROR.name(), EventSeverity.FATAL.name());

       } else {
           List<String> values = new ArrayList<String>(5);
           if (currentValue.toUpperCase().contains(EventSeverity.FATAL.name())) {
               values.add(EventSeverity.FATAL.name());
           }
           if (currentValue.toUpperCase().contains(EventSeverity.ERROR.name())) {
               values.add(EventSeverity.ERROR.name());
           }
           if (currentValue.toUpperCase().contains(EventSeverity.WARN.name())) {
               values.add(EventSeverity.WARN.name());
           }
           if (currentValue.toUpperCase().contains(EventSeverity.INFO.name())) {
               values.add(EventSeverity.INFO.name());
           }
           if (currentValue.toUpperCase().contains(EventSeverity.DEBUG.name())) {
               values.add(EventSeverity.DEBUG.name());
           }
           severityFilter.setValues(values.toArray(new String[values.size()]));
       }

       return severityFilter;
   }
View Full Code Here

        final FormItemIcon executeButton = new FormItemIcon();
        executeButton.setName("execute");
        executeButton.setSrc(ImageManager.getOperationIcon());
        executeButton.setPrompt(MSG.common_button_execute());

        final SelectItem controlNamesItem = new SortedSelectItem("controlMenu",
            MSG.view_admin_plugins_serverControls_name());
        LinkedHashMap<String, String> controlNames = new LinkedHashMap<String, String>();
        for (ServerPluginControlDefinition def : controlDefinitions) {
            controlNames.put(def.getName(), def.getDisplayName());
        }
        controlNamesItem.setValueMap(controlNames);
        controlNamesItem.setWidth(300);
        controlNamesItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                // determine the control that was selected and remember information about it
                selectedControlName = (String) event.getValue();
                ServerPluginControlDefinition def = getControlDefinition(selectedControlName);
                selectedParamsDef = def.getParameters();
                selectedResultsDef = def.getResults();

                // we changed the control selected, hide any previously shown results
                resultsLayout.destroyMembers();
                resultsLayout.setVisible(false);

                // show the parameters, if there are any
                showParameters();

                // make sure we show our execute button now that a control has been selected
                if (controlNamesItem.getIcon(executeButton.getName()) == null) {
                    controlNamesItem.setIcons(executeButton);
                }
            }
        });
        form.setItems(controlNamesItem);
View Full Code Here

    /* Single select combobox for sort order of items to display on dashboard
     *
     * @return Populated selectItem instance.
     */
    public static SelectItem getResulSortOrderEditor(Configuration portletConfig) {
        SelectItem sortPrioritySelection = new SelectItem(Constant.RESULT_SORT_PRIORITY, MSG.common_title_sort_order());
        sortPrioritySelection.setWrapTitle(false);
        sortPrioritySelection.setTooltip(MSG.common_title_sort_order_tooltip());
        LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(2);
        priorities.put(PageOrdering.ASC.name(), "Ascending");
        priorities.put(PageOrdering.DESC.name(), "Descending");
        LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(2);
        priorityIcons.put(PageOrdering.ASC.name(), "ascending");
        priorityIcons.put(PageOrdering.DESC.name(), "descending");

        sortPrioritySelection.setValueMap(priorities);
        sortPrioritySelection.setValueIcons(priorityIcons);
        //TODO: spinder 3/4/11 not sure why this is necessary. [SKIN] not being interpreted.
        String skinDir = "../org.rhq.coregui.CoreGUI/sc/skins/Enterprise/images";
        sortPrioritySelection.setImageURLPrefix(skinDir + "/actions/sort_");
        sortPrioritySelection.setImageURLSuffix(".png");

        //reload current settings if they exist, otherwise enable all.
        String currentValue = portletConfig.getSimpleValue(Constant.RESULT_SORT_ORDER,
            Constant.RESULT_SORT_ORDER_DEFAULT);
        if (currentValue.isEmpty()) {
            sortPrioritySelection.setDefaultValue(Constant.RESULT_SORT_ORDER_DEFAULT);
        } else {
            sortPrioritySelection.setDefaultValue(currentValue);
        }
        return sortPrioritySelection;
    }
View Full Code Here

    public static CustomConfigMeasurementRangeEditor getMeasurementRangeEditor(Configuration portletConfig) {
        return new CustomConfigMeasurementRangeEditor(portletConfig);
    }

    public static SelectItem getOperationStatusEditor(Configuration portletConfig) {
        SelectItem priorityFilter = new SelectItem(Constant.OPERATION_STATUS, MSG.common_title_operation_status());
        priorityFilter.setWrapTitle(false);
        priorityFilter.setWidth(325);
        priorityFilter.setMultiple(true);
        priorityFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);

        LinkedHashMap<String, String> stati = new LinkedHashMap<String, String>(4);
        stati.put(OperationRequestStatus.SUCCESS.name(), MSG.common_status_success());
        stati.put(OperationRequestStatus.INPROGRESS.name(), MSG.common_status_inprogress());
        stati.put(OperationRequestStatus.CANCELED.name(), MSG.common_status_canceled());
        stati.put(OperationRequestStatus.FAILURE.name(), MSG.common_status_failed());

        LinkedHashMap<String, String> statusIcons = new LinkedHashMap<String, String>(3);
        statusIcons.put(OperationRequestStatus.SUCCESS.name(),
            ImageManager.getOperationResultsIcon(OperationRequestStatus.SUCCESS));
        statusIcons.put(OperationRequestStatus.INPROGRESS.name(),
            ImageManager.getOperationResultsIcon(OperationRequestStatus.INPROGRESS));
        statusIcons.put(OperationRequestStatus.CANCELED.name(),
            ImageManager.getOperationResultsIcon(OperationRequestStatus.CANCELED));
        statusIcons.put(OperationRequestStatus.FAILURE.name(),
            ImageManager.getOperationResultsIcon(OperationRequestStatus.FAILURE));
        priorityFilter.setValueMap(stati);
        priorityFilter.setValueIcons(statusIcons);
        //reload current settings if they exist, otherwise enable all.
        String currentValue = portletConfig
            .getSimpleValue(Constant.OPERATION_STATUS, Constant.OPERATION_STATUS_DEFAULT);
        if (currentValue.isEmpty() || currentValue.split(",").length == OperationRequestStatus.values().length) {
            priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(), OperationRequestStatus.INPROGRESS.name(),
                OperationRequestStatus.CANCELED.name(), OperationRequestStatus.FAILURE.name());
        } else {
            //spinder:3/4/11 doing this nonsense due to some weird smartgwt issue with SelectItem in VLayout.
            if (currentValue.equalsIgnoreCase(OperationRequestStatus.SUCCESS.name())) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS,CANCELED,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(),
                    OperationRequestStatus.INPROGRESS.name(), OperationRequestStatus.CANCELED.name(),
                    OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS,CANCELED")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(),
                    OperationRequestStatus.INPROGRESS.name(), OperationRequestStatus.CANCELED.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(),
                    OperationRequestStatus.INPROGRESS.name(), OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(),
                    OperationRequestStatus.INPROGRESS.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,CANCELED,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(), OperationRequestStatus.CANCELED.name(),
                    OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,CANCELED")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(), OperationRequestStatus.CANCELED.name());
            } else if (currentValue.equalsIgnoreCase("SUCCESS,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.SUCCESS.name(), OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("INPROGRESS")) {
                priorityFilter.setValues(OperationRequestStatus.INPROGRESS.name());
            } else if (currentValue.equalsIgnoreCase("INPROGRESS,CANCELED,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.INPROGRESS.name(),
                    OperationRequestStatus.CANCELED.name(), OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("INPROGRESS,CANCELED")) {
                priorityFilter.setValues(OperationRequestStatus.INPROGRESS.name(),
                    OperationRequestStatus.CANCELED.name());
            } else if (currentValue.equalsIgnoreCase("INPROGRESS,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.INPROGRESS.name(),
                    OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("CANCELED")) {
                priorityFilter.setValues(OperationRequestStatus.CANCELED.name());
            } else if (currentValue.equalsIgnoreCase("CANCELED,FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.CANCELED.name(), OperationRequestStatus.FAILURE.name());
            } else if (currentValue.equalsIgnoreCase("FAILURE")) {
                priorityFilter.setValues(OperationRequestStatus.FAILURE.name());
            }
        }
        return priorityFilter;
    }
View Full Code Here

        final TextItem securePortItem = new TextItem(FIELD_SECURE_PORT.propertyName(), FIELD_SECURE_PORT.title());
        securePortItem.setRequired(true);
        securePortItem.setValidators(portValidator);
        securePortItem.setValue(server.getSecurePort());

        final SelectItem operationModeItem = new SelectItem(FIELD_OPERATION_MODE.propertyName(),
            MSG.view_adminTopology_serverDetail_operationMode());
        operationModeItem.setValueMap("NORMAL", "MAINTENANCE");
        operationModeItem.setValue(server.getOperationMode());

        // make clickable link for affinity group
        StaticTextItem affinityGroupItem = new StaticTextItem(FIELD_AFFINITY_GROUP.propertyName(),
            FIELD_AFFINITY_GROUP.title());
        String affinityGroupItemText = "";
        AffinityGroup ag = server.getAffinityGroup();
        if (ag != null && ag.getName() != null && !ag.getName().isEmpty()) {
            String detailsUrl = "#" + AffinityGroupTableView.VIEW_PATH + "/" + ag.getId();
            String formattedValue = StringUtility.escapeHtml(ag.getName());
            affinityGroupItemText = LinkManager.getHref(detailsUrl, formattedValue);
        }
        affinityGroupItem.setValue(affinityGroupItemText);

        StaticTextItem installationDateItem = new StaticTextItem(FIELD_CTIME.propertyName(), FIELD_CTIME.title());
        installationDateItem.setValue(TimestampCellFormatter.format(Long.valueOf(server.getCtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_LONG));

        StaticTextItem lastUpdateItem = new StaticTextItem(FIELD_MTIME.propertyName(), FIELD_MTIME.title());
        lastUpdateItem.setValue(TimestampCellFormatter.format(Long.valueOf(server.getMtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_LONG));

        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.setOverflow(Overflow.VISIBLE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (form.validate()) {
                    server.setAddress(addressItem.getValueAsString());
                    server.setPort(Integer.parseInt(portItem.getValueAsString()));
                    server.setSecurePort(Integer.parseInt(securePortItem.getValueAsString()));
                    server.setOperationMode(OperationMode.valueOf(operationModeItem.getValueAsString()));
                    GWTServiceLookup.getTopologyService().updateServer(server, new AsyncCallback<Void>() {
                        public void onSuccess(Void result) {
                            Message msg = new Message(MSG.view_adminTopology_message_serverUpdated(server.getName()),
                                Message.Severity.Info);
                            CoreGUI.getMessageCenter().notify(msg);
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.