diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-11-20 12:33:35 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-11-20 12:33:35 +0000 |
commit | ab4e63b78dd81ccc99d81d3fc4cb9f9455d5fce6 (patch) | |
tree | b3c94666ed2ba1896a04e3eca1a3c71d256fb611 /src/com/vaadin/ui/Embedded.java | |
parent | f8ca6621b3fba6e01aaa3088a391f1a2b624b5b9 (diff) | |
download | vaadin-framework-ab4e63b78dd81ccc99d81d3fc4cb9f9455d5fce6.tar.gz vaadin-framework-ab4e63b78dd81ccc99d81d3fc4cb9f9455d5fce6.zip |
Initial commit for framework enhancement for #3234
svn changeset:9947/svn branch:event-framework-3234
Diffstat (limited to 'src/com/vaadin/ui/Embedded.java')
-rw-r--r-- | src/com/vaadin/ui/Embedded.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/vaadin/ui/Embedded.java b/src/com/vaadin/ui/Embedded.java index 3b20641c5f..be60b744aa 100644 --- a/src/com/vaadin/ui/Embedded.java +++ b/src/com/vaadin/ui/Embedded.java @@ -7,6 +7,8 @@ package com.vaadin.ui; import java.util.Hashtable; import java.util.Iterator; +import com.vaadin.event.MouseEvents.ClickEvent; +import com.vaadin.event.MouseEvents.ClickListener; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; import com.vaadin.terminal.Resource; @@ -414,4 +416,20 @@ public class Embedded extends AbstractComponent { } } + public void addListener(ClickListener listener) { + addEventListener("click", ClickEvent.class, listener, + ClickListener.clickMethod); + } + + public void removeListener(ClickListener listener) { + removeEventListener("click", ClickEvent.class, listener, + ClickListener.clickMethod); + } + + @Override + protected void handleEvent(String event, String[] parameters) { + if (event.equals("click")) { + fireEvent(new ClickEvent(this, parameters[0])); + } + } } |