]> source.dussan.org Git - vaadin-framework.git/commitdiff
Reverted [17697]
authorJohn Alhroos <john.ahlroos@itmill.com>
Thu, 10 Mar 2011 11:16:08 +0000 (11:16 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Thu, 10 Mar 2011 11:16:08 +0000 (11:16 +0000)
svn changeset:17704/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ui/VButton.java
src/com/vaadin/ui/Button.java

index 49aa520df1a76fef4389cddf70c718db51b768ea..5a5eb0eda6ebe254b1db93e1d47600cef7844834 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/* 
 @ITMillApache2LicenseForJavaFiles@
  */
 
@@ -23,7 +23,6 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.EventHelper;
 import com.vaadin.terminal.gwt.client.EventId;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
 import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
@@ -354,12 +353,7 @@ public class VButton extends FocusWidget implements Paintable, ClickHandler,
         if (BrowserInfo.get().isSafari()) {
             VButton.this.setFocus(true);
         }
-        client.updateVariable(id, "state", true, false);
-
-        // Add mouse details
-        MouseEventDetails details = new MouseEventDetails(
-                event.getNativeEvent());
-        client.updateVariable(id, "mousedetails", details.serialize(), true);
+        client.updateVariable(id, "state", true, true);
 
         clickPending = false;
     }
index 22ab0a62a3682028191cc3d0922a4cc38ee307bc..cf354750a8f98a042e264cdb1d22c66ed265c226 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/* 
 @ITMillApache2LicenseForJavaFiles@
  */
 
@@ -21,7 +21,6 @@ import com.vaadin.event.ShortcutAction.ModifierKey;
 import com.vaadin.event.ShortcutListener;
 import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
 import com.vaadin.terminal.gwt.client.ui.VButton;
 import com.vaadin.ui.ClientWidget.LoadStyle;
 import com.vaadin.ui.themes.BaseTheme;
@@ -43,9 +42,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier,
 
     boolean switchMode = false;
 
-    /* Last mouse details from the last click event */
-    private MouseEventDetails mouseDetails;
-
     /**
      * Creates a new push button. The value of the push button is false and it
      * is immediate by default.
@@ -172,12 +168,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier,
             final Boolean newValue = (Boolean) variables.get("state");
             final Boolean oldValue = (Boolean) getValue();
 
-            // Handle mouse details
-            if (variables.containsKey("mousedetails")) {
-                mouseDetails = MouseEventDetails.deSerialize((String) variables
-                        .get("mousedetails"));
-            }
-
             if (isSwitchMode()) {
 
                 // For switch button, the event is only sent if the
@@ -310,8 +300,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier,
      */
     public class ClickEvent extends Component.Event {
 
-        private MouseEventDetails details;
-
         /**
          * New instance of text change event.
          * 
@@ -322,19 +310,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier,
             super(source);
         }
 
-        /**
-         * Event which is trigged when the button was clicked
-         * 
-         * @param source
-         *      The Component that triggered the event
-         * @param details
-         *      Additional details about the mouse event
-         */
-        public ClickEvent(Component source, MouseEventDetails details) {
-            super(source);
-            this.details = details;
-        }
-
         /**
          * Gets the Button where the event occurred.
          * 
@@ -343,57 +318,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier,
         public Button getButton() {
             return (Button) getSource();
         }
-
-        /**
-         * Checks if the Alt key was down when the mouse event took place.
-         * 
-         * @return true if Alt was down when the event occured, false otherwise
-         */
-        public boolean isAltKey() {
-            if (details != null) {
-                return details.isAltKey();
-            }
-            return false;
-        }
-
-        /**
-         * Checks if the Ctrl key was down when the mouse event took place.
-         * 
-         * @return true if Ctrl was pressed when the event occured, false
-         *         otherwise
-         */
-        public boolean isCtrlKey() {
-            if (details != null) {
-                return details.isCtrlKey();
-            }
-            return false;
-        }
-
-        /**
-         * Checks if the Meta key was down when the mouse event took place.
-         * 
-         * @return true if Meta was pressed when the event occured, false
-         *         otherwise
-         */
-        public boolean isMetaKey() {
-            if (details != null) {
-                return details.isMetaKey();
-            }
-            return false;
-        }
-
-        /**
-         * Checks if the Shift key was down when the mouse event took place.
-         * 
-         * @return true if Shift was pressed when the event occured, false
-         *         otherwise
-         */
-        public boolean isShiftKey() {
-            if (details != null) {
-                return details.isShiftKey();
-            }
-            return false;
-        }
     }
 
     /**
@@ -441,7 +365,7 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier,
      * Emits the options change event.
      */
     protected void fireClick() {
-        fireEvent(new Button.ClickEvent(this, mouseDetails));
+        fireEvent(new Button.ClickEvent(this));
     }
 
     @Override