diff options
author | Artur Signell <artur@vaadin.com> | 2012-02-21 16:17:57 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-02-21 16:17:57 +0200 |
commit | 23bca2af5ed2080e7bbe2e36791c2208f91d8084 (patch) | |
tree | a6f6acdf98e732365732595e8d38e81b157ab134 /src/com/vaadin/ui/Button.java | |
parent | 6dae5cd35f3811146d3cf8a8d67baaa637d9af4c (diff) | |
download | vaadin-framework-23bca2af5ed2080e7bbe2e36791c2208f91d8084.tar.gz vaadin-framework-23bca2af5ed2080e7bbe2e36791c2208f91d8084.zip |
#8304 Changed Button to solely use shared state
Diffstat (limited to 'src/com/vaadin/ui/Button.java')
-rw-r--r-- | src/com/vaadin/ui/Button.java | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index b88cab81d9..4ca274abf9 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -4,7 +4,6 @@ package com.vaadin.ui; -import java.io.IOException; import java.io.Serializable; import java.lang.reflect.Method; import java.util.Map; @@ -19,11 +18,8 @@ import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutAction.KeyCode; 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.ComponentState; import com.vaadin.terminal.gwt.client.MouseEventDetails; -import com.vaadin.terminal.gwt.client.ui.VButton; import com.vaadin.terminal.gwt.client.ui.VButton.ButtonClientToServerRpc; import com.vaadin.terminal.gwt.client.ui.VButtonPaintable; import com.vaadin.terminal.gwt.client.ui.VButtonState; @@ -89,28 +85,6 @@ public class Button extends AbstractComponent implements } /** - * Paints the content of this component. - * - * @param event - * the PaintEvent. - * @throws IOException - * if the writing failed due to input/output error. - * @throws PaintException - * if the paint operation failed. - */ - @Override - public void paintContent(PaintTarget target) throws PaintException { - super.paintContent(target); - - if (isDisableOnClick()) { - target.addAttribute(VButton.ATTR_DISABLE_ON_CLICK, true); - } - if (clickShortcut != null) { - target.addAttribute("keycode", clickShortcut.getKeyCode()); - } - } - - /** * Invoked when the value of a variable has changed. Button listeners are * notified if the button is clicked. * @@ -404,6 +378,7 @@ public class Button extends AbstractComponent implements } clickShortcut = new ClickShortcut(this, keyCode, modifiers); addShortcutListener(clickShortcut); + getState().setClickShortcutKeyCode(clickShortcut.getKeyCode()); } /** @@ -414,6 +389,7 @@ public class Button extends AbstractComponent implements if (clickShortcut != null) { removeShortcutListener(clickShortcut); clickShortcut = null; + getState().setClickShortcutKeyCode(0); } } |