diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2016-09-28 16:59:58 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-10-05 12:37:19 +0000 |
commit | 2f6334fe6c8c7dd1354ad850c4b713699573b227 (patch) | |
tree | 36bb016a4839923bd02dcd58286c7d19920158fc /client | |
parent | 6b229978accda593f1ba08fc31c262a994df000a (diff) | |
download | vaadin-framework-2f6334fe6c8c7dd1354ad850c4b713699573b227.tar.gz vaadin-framework-2f6334fe6c8c7dd1354ad850c4b713699573b227.zip |
Make ColorPicker subcomponents HasValues
Change-Id: Ia0502ef515e2b44f105a3a4c6ae7b0b62b8ab6bb
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java index c05449d7bd..a454492391 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java @@ -19,8 +19,8 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.MouseUpEvent; import com.google.gwt.event.dom.client.MouseUpHandler; import com.google.gwt.user.client.ui.Widget; +import com.vaadin.client.annotations.OnStateChange; import com.vaadin.client.communication.RpcProxy; -import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; @@ -64,22 +64,18 @@ public class ColorPickerGradientConnector extends AbstractComponentConnector } @Override - public void onStateChanged(StateChangeEvent stateChangeEvent) { - super.onStateChanged(stateChangeEvent); - if (stateChangeEvent.hasPropertyChanged("cursorX") - || stateChangeEvent.hasPropertyChanged("cursorY")) { - - getWidget().setCursor(getState().cursorX, getState().cursorY); - } - if (stateChangeEvent.hasPropertyChanged("bgColor")) { - getWidget().setBGColor(getState().bgColor); - } - } - - @Override protected void init() { super.init(); getWidget().addMouseUpHandler(this); } + @OnStateChange({ "cursorX", "cursorY" }) + void updateCursor() { + getWidget().setCursor(getState().cursorX, getState().cursorY); + } + + @OnStateChange("bgColor") + void updateBgColor() { + getWidget().setBGColor(getState().bgColor); + } } |