diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-24 10:05:38 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-24 10:05:38 +0000 |
commit | 4e1d1321ec50c130aafca8d1251a71f12f5e28d1 (patch) | |
tree | 1e90d6c509563ecdd84a9946d45dd81649075e31 /src/com/vaadin/ui/TextField.java | |
parent | 1b55615e5157517eed59265776bad0dcbbdc53d3 (diff) | |
download | vaadin-framework-4e1d1321ec50c130aafca8d1251a71f12f5e28d1.tar.gz vaadin-framework-4e1d1321ec50c130aafca8d1251a71f12f5e28d1.zip |
fixes #3913
svn changeset:12055/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/ui/TextField.java')
-rw-r--r-- | src/com/vaadin/ui/TextField.java | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/com/vaadin/ui/TextField.java b/src/com/vaadin/ui/TextField.java index a3f76160a7..88451717ce 100644 --- a/src/com/vaadin/ui/TextField.java +++ b/src/com/vaadin/ui/TextField.java @@ -89,9 +89,6 @@ public class TextField extends AbstractField implements */ private int maxLength = -1; - private static final String BLUR_EVENT = VTextField.BLUR_EVENT_IDENTIFIER; - private static final String FOCUS_EVENT = VTextField.FOCUS_EVENT_IDENTIFIER; - /* Constructors */ /** @@ -280,11 +277,11 @@ public class TextField extends AbstractField implements } } - if (variables.containsKey(FOCUS_EVENT)) { - fireFocus(variables.get(FOCUS_EVENT)); + if (variables.containsKey(FocusEvent.EVENT_ID)) { + fireEvent(new FocusEvent(this)); } - if (variables.containsKey(BLUR_EVENT)) { - fireBlur(variables.get(BLUR_EVENT)); + if (variables.containsKey(BlurEvent.EVENT_ID)) { + fireEvent(new BlurEvent(this)); } } @@ -619,30 +616,22 @@ public class TextField extends AbstractField implements requestRepaint(); } - private void fireFocus(Object object) { - fireEvent(new FocusEvent(this)); - } - - private void fireBlur(Object object) { - fireEvent(new BlurEvent(this)); - } - public void addListener(FocusListener listener) { - addListener(FOCUS_EVENT, FocusEvent.class, listener, + addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } public void removeListener(FocusListener listener) { - removeListener(FOCUS_EVENT, FocusEvent.class, listener); + removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); } public void addListener(BlurListener listener) { - addListener(BLUR_EVENT, BlurEvent.class, listener, + addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } public void removeListener(BlurListener listener) { - removeListener(BLUR_EVENT, BlurEvent.class, listener); + removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } } |