class ToggleSwitchEditor implements IsWidget, LeafAttributeEditor<Boolean> {

    void onValueChanged(final Boolean value) {
        // Check value is not same one as current.
        if (this.value != null && this.value.equals(value)) return;
        
        // Clear error messages on the view.
        view.clearError();
                
        // Set the new value.
        Boolean before = this.value;
        this.value = value;

        // Fire the value change event.
        valueChangeEvent.fire(new org.dashbuilder.common.client.event.ValueChangeEvent<Boolean>(this, before, this.value));
        
    }

    @Inject public  ToggleSwitchEditor(final View view,
                              final Event<org.dashbuilder.common.client.event.ValueChangeEvent<Boolean>> valueChangeEvent);

}