From ba543196bcd88423b78f66407755de88f34793f3 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Thu, 10 Mar 2011 11:16:08 +0000 Subject: [PATCH] Reverted [17697] svn changeset:17704/svn branch:6.5 --- .../terminal/gwt/client/ui/VButton.java | 10 +-- src/com/vaadin/ui/Button.java | 80 +------------------ 2 files changed, 4 insertions(+), 86 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/VButton.java index 49aa520df1..5a5eb0eda6 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VButton.java @@ -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; } diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index 22ab0a62a3..cf354750a8 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -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 -- 2.39.5