Java Code Examples for com.smartgwt.client.widgets.form.fields.events.ChangedEvent#getSource()

The following examples show how to use com.smartgwt.client.widgets.form.fields.events.ChangedEvent#getSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SubscriptionListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
protected ChangedHandler createActivateChangedHandler(final ListGridRecord ruleRecord) {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            CheckboxItem checkbox = (CheckboxItem) event.getSource();
            boolean checked = checkbox.getValueAsBoolean().booleanValue();
            String uuid = ruleRecord.getAttribute(UUID);
            String medium = ruleRecord.getAttribute(MEDIUM);
            String format = ruleRecord.getAttribute(FORMAT);
            ruleRecord.setAttribute(SUBSCRIBED, checked);
            if(checked) {
                getMainEventBus().fireEvent(new SubscribeEvent(currentSession(), uuid, medium, format));
            } else {
                getMainEventBus().fireEvent(new UnsubscribeEvent(currentSession(), uuid, medium, format));
            }
        }
    };
}
 
Example 2
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createEntryOperatorChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            SelectItem selectItem = (SelectItem) event.getSource();
            String operator = selectItem.getValueAsString();
            String inverseOperator = getInverse(operator);
            controller.getOverUndershootEntryConditions().setOperator(operator);
            exitOperatorItem.setValue(inverseOperator);
            controller.getOverUndershootExitConditions().setOperator(inverseOperator);
        }
    };
}
 
Example 3
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createEntryValueChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            TextItem valueItem = (TextItem) event.getSource();
            String value = valueItem.getValueAsString();
            controller.getOverUndershootEntryConditions().setValue(value);
            
            exitValueItem.setValue(value);
            // setting exit value does not invoke ChangedHandler :(
            controller.getOverUndershootExitConditions().setValue(value);
        }
    };
}
 
Example 4
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createExitOperatorChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            SelectItem selectItem = (SelectItem) event.getSource();
            String operator = selectItem.getValueAsString();
            controller.getOverUndershootExitConditions().setOperator(operator);
        }
    };
}
 
Example 5
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createExitValueChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            TextItem valueItem = (TextItem) event.getSource();
            String value = valueItem.getValueAsString();
            controller.getOverUndershootExitConditions().setValue(value);
        }
    };
}
 
Example 6
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createEntryUnitChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            SelectItem valueItem = (SelectItem) event.getSource();
            String unitValue = valueItem.getValueAsString();
            controller.getSensorLossConditions().setUnit(unitValue);
        }
    };
}
 
Example 7
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createValueChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            TextItem valueItem = (TextItem) event.getSource();
            String thresholdValue = valueItem.getValueAsString();
            controller.getSensorLossConditions().setValue(thresholdValue);
        }
    };
}