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

Examples of com.smartgwt.client.widgets.form.fields.events.ChangedHandler


            TextItem name = new TextItem("name", MSG.common_title_name());
            name.setRequired(true);
            name.setWidth(300);
            name.setLength(100);
            name.addChangedHandler(new ChangedHandler() {
                @Override
                public void onChanged(ChangedEvent changedEvent) {

                    final String newGroupName = form.getValueAsString("name");
View Full Code Here


        expression = new TextAreaItem("expression", MSG.view_dynagroup_expression());
        expression.setWidth(400);
        expression.setHeight(150);
        expression.setDefaultValue("");
        expression.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                // the user changed the expression text, clear the template drop down
                // so the user isn't confused thinking this new value is the template text
                templateSelector.clearValue();
            }
        });
        if (builder != null) {
            builder.destroy();
            builder = null;
        }

        templateSelector.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                if (event.getValue() != null) {
                    String selectedTemplateId = event.getValue().toString();
                    // user picked one of the canned expressions - update field values
View Full Code Here

            items.add(passwordItem);

            final PasswordItem verifyPasswordItem = new PasswordItem(UsersDataSource.Field.PASSWORD_VERIFY);
            verifyPasswordItem.setShowTitle(true);
            final boolean[] initialPasswordChange = { true };
            passwordItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    if (initialPasswordChange[0]) {
                        verifyPasswordItem.clearValue();
                        initialPasswordChange[0] = false;
                    }
View Full Code Here

                public void onChange(ChangeEvent event) {
                    event.cancel();
                    cursorPosition = adviceItem.getSelectionRange()[0];
                }
            });
            adviceItem.addChangedHandler(new ChangedHandler() {

                @Override
                public void onChanged(ChangedEvent event) {
                    adviceItem.setSelectionRange(cursorPosition, cursorPosition);
                }
View Full Code Here

            deployTimeValues.put(DEPLOY_LATER, MSG.view_bundle_deployWizard_getOptions_deployLater());
            rgDeployTimeItem.setRequired(true);
            rgDeployTimeItem.setValueMap(deployTimeValues);
            rgDeployTimeItem.setValue(DEPLOY_NOW);
            wizard.setDeployNow(true);
            rgDeployTimeItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    wizard.setDeployNow(DEPLOY_NOW.equals(event.getValue()));
                }
            });
View Full Code Here

            // Add the icon that user can click to edit the member values.
            FormItemIcon icon = buildEditMemberValuesIcon(propertyDefinitionSimple, propertySimple, item);

            item.setIcons(icon);

            item.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent changedEvent) {
                    Object value = changedEvent.getValue();
                    updateMemberProperties(propertySimple, value);
                }
            });
View Full Code Here

                unsetItem.setValue(unset);
                unsetItem.setDisabled(isReadOnly(propertyDefinitionSimple, masterPropertySimple));
                unsetItem.setShowLabel(false);
                unsetItem.setLabelAsTitle(false);

                unsetItem.addChangedHandler(new ChangedHandler() {
                    public void onChanged(ChangedEvent changedEvent) {
                        Boolean isUnset = (Boolean) changedEvent.getValue();
                        masterValueItem.setDisabled(isUnset);
                        if (isUnset) {
                            setValue(masterValueItem, null);
                        }
                        masterValueItem.redraw();
                    }
                });

                masterValueItem.addChangeHandler(new ChangeHandler() {
                    public void onChange(ChangeEvent event) {
                        if (event.getValue() == null || event.getValue().toString().length() == 0) {
                            unsetItem.setValue(true);
                        } else {
                            unsetItem.setValue(false);
                        }
                    }
                });

                masterUnsetItem = unsetItem;
            } else {
                masterUnsetItem = new SpacerItem();
            }

            masterUnsetItem.setShowTitle(false);
            masterUnsetItem.setStartRow(false);
            masterUnsetItem.setEndRow(false);
            masterUnsetItem.setAlign(Alignment.CENTER);
            if (masterUnsetItem instanceof CheckboxItem) {
                masterUnsetItem.setValue(false);
            } else {
                masterUnsetItem.setVisible(false);
            }

            // the "set all values to" apply button
            final ButtonItem applyButton = new ButtonItem("apply", MSG.view_groupConfigEdit_setAll());
            applyButton.setDisabled(true);
            applyButton.setAlign(Alignment.RIGHT);
            applyButton.setStartRow(true);
            applyButton.setEndRow(false);

            applyButton.addClickHandler(new ClickHandler() {
                public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                    if (masterValueItem.validate()) {
                        Object value = masterValueItem.getValue();

                        // Update the member property value items.
                        for (ListGridRecord field : data) {
                            String stringValue = (value != null) ? value.toString() : null;
                            field.setAttribute(FIELD_VALUE, stringValue);
                            field.setAttribute(FIELD_UNSET, value == null);
                        }

                        // since we know the master value is ok and has validated,
                        // we can clear all validation errors and re-enable the OK button
                        memberValuesGrid.discardAllEdits();
                        okButton.enable();

                        // redraw grid with the new values
                        memberValuesGrid.redraw();
                    }
                }
            });

            masterValueItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent changedEvent) {
                    applyButton.enable();
                }
            });

            masterUnsetItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent changedEvent) {
                    applyButton.enable();
                    if ((Boolean) changedEvent.getValue()) {
                        applyButton.focusInItem(); // unsetting value, nothing to enter so go to apply button
                    } else {
View Full Code Here

        CheckboxItem checkboxItem = new CheckboxItem("updateExistingSchedules",
            MSG.view_admin_measTemplates_updateExisting_title());
        checkboxItem.setDefaultValue(schedulesView.isUpdateExistingSchedules());
        checkboxItem.setTooltip(MSG.view_admin_measTemplates_updateExisting_tooltip());
        checkboxItem.setHoverWidth(200);
        checkboxItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent changedEvent) {
                boolean newValue = (Boolean) changedEvent.getValue();
                schedulesView.setUpdateExistingSchedules(newValue);
            }
        });
View Full Code Here

                .view_alert_common_tab_dampening_consecutive_occurrences_label_tooltip());
            consecutiveOccurrencesStatic = new StaticTextItem("consecutiveOccurrencesStatic",
                MSG.view_alert_common_tab_dampening_consecutive_occurrences_label());
            consecutiveOccurrencesStatic.setWrapTitle(false);

            consecutiveOccurrencesSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            //  PARTIAL_COUNT
            partialOccurrencesSpinner = new SpinnerItem("partialOccurrencesSpinner",
                MSG.view_alert_common_tab_dampening_partial_occurrences_label());
            partialOccurrencesSpinner.setWrapTitle(false);
            partialOccurrencesSpinner.setMin(1);
            partialOccurrencesSpinner.setMax(999999);
            partialOccurrencesSpinner.setStep(1);
            partialOccurrencesSpinner.setDefaultValue(1);
            partialOccurrencesSpinner.setHoverWidth(300);
            partialOccurrencesSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_partial_occurrences_label_tooltip());
            partialOccurrencesStatic = new StaticTextItem("partialOccurrencesStatic",
                MSG.view_alert_common_tab_dampening_partial_occurrences_label());
            partialOccurrencesStatic.setWrapTitle(false);

            partialOccurrencesSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            partialEvaluationsSpinner = new SpinnerItem("partialEvaluationsSpinner",
                MSG.view_alert_common_tab_dampening_partial_evalatuions_label());
            partialEvaluationsSpinner.setWrapTitle(false);
            partialEvaluationsSpinner.setMin(1);
            partialEvaluationsSpinner.setMax(999999);
            partialEvaluationsSpinner.setStep(1);
            partialEvaluationsSpinner.setDefaultValue(1);
            partialEvaluationsSpinner.setHoverWidth(300);
            partialEvaluationsSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_partial_evalatuions_label_tooltip());
            partialEvaluationsStatic = new StaticTextItem("partialEvaluationStatic",
                MSG.view_alert_common_tab_dampening_partial_evalatuions_label());
            partialEvaluationsStatic.setWrapTitle(false);

            partialEvaluationsSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            //  DURATION_COUNT
            durationOccurrencesSpinner = new SpinnerItem("durationOccurrencesSpinner",
                MSG.view_alert_common_tab_dampening_duration_occurrences_label());
            durationOccurrencesSpinner.setWrapTitle(false);
            durationOccurrencesSpinner.setMin(1);
            durationOccurrencesSpinner.setMax(999999);
            durationOccurrencesSpinner.setStep(1);
            durationOccurrencesSpinner.setDefaultValue(1);
            durationOccurrencesSpinner.setHoverWidth(300);
            durationOccurrencesSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_duration_occurrences_label_tooltip());
            durationOccurrencesStatic = new StaticTextItem("durationOccurrencesStatic",
                MSG.view_alert_common_tab_dampening_duration_occurrences_label());
            durationOccurrencesStatic.setWrapTitle(false);

            durationOccurrencesSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            durationTimePeriodSpinner = new SpinnerItem("durationTimePeriodSpinner",
                MSG.view_alert_common_tab_dampening_duration_period_label());
            durationTimePeriodSpinner.setWrapTitle(false);
            durationTimePeriodSpinner.setMin(1);
            durationTimePeriodSpinner.setMax(999999);
            durationTimePeriodSpinner.setStep(1);
            durationTimePeriodSpinner.setDefaultValue(1);
            durationTimePeriodSpinner.setHoverWidth(300);
            durationTimePeriodSpinner.setTooltip(MSG.view_alert_common_tab_dampening_duration_period_label_tooltip());
            durationTimePeriodStatic = new StaticTextItem("durationTimePeriodStatic",
                MSG.view_alert_common_tab_dampening_duration_period_label());
            durationTimePeriodStatic.setWrapTitle(false);

            durationTimePeriodSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            durationTimeUnitsSelection = new SelectItem("durationTimeUnits", "");
            LinkedHashMap<String, String> units = new LinkedHashMap<String, String>(4);
            units.put(AlertDampening.TimeUnits.MINUTES.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.MINUTES));
            units.put(AlertDampening.TimeUnits.HOURS.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.HOURS));
            units.put(AlertDampening.TimeUnits.DAYS.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.DAYS));
            units.put(AlertDampening.TimeUnits.WEEKS.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.WEEKS));
            durationTimeUnitsSelection.setValueMap(units);
            durationTimeUnitsSelection.setDefaultValue(AlertDampening.TimeUnits.MINUTES.name());
            durationTimeUnitsStatic = new StaticTextItem("durationTimeUnitsStatic", "");

            durationTimeUnitsSelection.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            dampeningRuleSelection.addChangedHandler(new ChangedHandler() {
                @Override
                public void onChanged(ChangedEvent event) {
                    updated = true;

                    Category cat = AlertDampening.Category.valueOf(event.getValue().toString());
View Full Code Here

        if (!latestEndpointValue.equals(endpoint)) {
          setEndpoint(endpoint, true);
        }
      }
    });
    endpoint.addChangedHandler(new ChangedHandler(){

      @Override
      public void onChanged(ChangedEvent event) {
        if (pickListRecordSelected == true) {
          //only perform when item from listgrid was selected. Otherwise on every keypress we'll do lots of processing
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.fields.events.ChangedHandler

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.