]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #3377 - VNativeButton clicklistener should be overridable
authorArtur Signell <artur.signell@itmill.com>
Mon, 1 Feb 2010 11:11:27 +0000 (11:11 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 1 Feb 2010 11:11:27 +0000 (11:11 +0000)
svn changeset:11072/svn branch:6.2

src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java

index e544e1f9ce76c9e662531855d335e564eec967e2..543a820dbdd84740686363ff052ffdd1dcc99388 100644 (file)
@@ -19,7 +19,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VTooltip;
 
-public class VNativeButton extends Button implements Paintable {
+public class VNativeButton extends Button implements Paintable, ClickHandler {
 
     public static final String CLASSNAME = "v-nativebutton";
 
@@ -48,18 +48,6 @@ public class VNativeButton extends Button implements Paintable {
         getElement().appendChild(captionElement);
         captionElement.setClassName(getStyleName() + "-caption");
 
-        addClickHandler(new ClickHandler() {
-            public void onClick(ClickEvent event) {
-                if (id == null || client == null) {
-                    return;
-                }
-                if (BrowserInfo.get().isSafari()) {
-                    VNativeButton.this.setFocus(true);
-                }
-                client.updateVariable(id, "state", true, true);
-                clickPending = false;
-            }
-        });
         sinkEvents(VTooltip.TOOLTIP_EVENTS);
         sinkEvents(Event.ONMOUSEDOWN);
         sinkEvents(Event.ONMOUSEUP);
@@ -179,4 +167,24 @@ public class VNativeButton extends Button implements Paintable {
         }
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event
+     * .dom.client.ClickEvent)
+     */
+    public void onClick(ClickEvent event) {
+        if (id == null || client == null) {
+            return;
+        }
+
+        if (BrowserInfo.get().isSafari()) {
+            VNativeButton.this.setFocus(true);
+        }
+
+        client.updateVariable(id, "state", true, true);
+        clickPending = false;
+    }
+
 }