summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/AbsoluteLayout.java
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2011-02-28 11:17:41 +0000
committerHenri Sara <henri.sara@itmill.com>2011-02-28 11:17:41 +0000
commit6fcd994f1af440fd276c23d2b0f7e9f3e7ec37e8 (patch)
tree80a5822bb6fdde3849045fb8fe2ebe653eec2693 /src/com/vaadin/ui/AbsoluteLayout.java
parent7756ba04dc4fff1222ceed5a44009883daaa9e30 (diff)
downloadvaadin-framework-6fcd994f1af440fd276c23d2b0f7e9f3e7ec37e8.tar.gz
vaadin-framework-6fcd994f1af440fd276c23d2b0f7e9f3e7ec37e8.zip
Merged changes from 6.5 branch
svn changeset:17493/svn branch:6.6
Diffstat (limited to 'src/com/vaadin/ui/AbsoluteLayout.java')
-rw-r--r--src/com/vaadin/ui/AbsoluteLayout.java59
1 files changed, 5 insertions, 54 deletions
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java
index 538cc26c77..3b0239af7b 100644
--- a/src/com/vaadin/ui/AbsoluteLayout.java
+++ b/src/com/vaadin/ui/AbsoluteLayout.java
@@ -12,10 +12,11 @@ import java.util.Map;
import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
+import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Sizeable;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.ui.VAbsoluteLayout;
/**
@@ -25,9 +26,10 @@ import com.vaadin.terminal.gwt.client.ui.VAbsoluteLayout;
*/
@SuppressWarnings("serial")
@ClientWidget(VAbsoluteLayout.class)
-public class AbsoluteLayout extends AbstractLayout {
+public class AbsoluteLayout extends AbstractLayout implements
+ LayoutClickNotifier {
- private static final String CLICK_EVENT = VAbsoluteLayout.CLICK_EVENT_IDENTIFIER;
+ private static final String CLICK_EVENT = EventId.LAYOUT_CLICK;
// The components in the layout
private Collection<Component> components = new LinkedHashSet<Component>();
@@ -560,62 +562,11 @@ public class AbsoluteLayout extends AbstractLayout {
}
}
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object,
- * java.util.Map)
- */
- @SuppressWarnings("unchecked")
- @Override
- public void changeVariables(Object source, Map<String, Object> variables) {
- super.changeVariables(source, variables);
- if (variables.containsKey(CLICK_EVENT)) {
- fireClick((Map<String, Object>) variables.get(CLICK_EVENT));
- }
-
- }
-
- /**
- * Fires a click event when the layout is clicked
- *
- * @param parameters
- * The parameters recieved from the client side implementation
- */
- private void fireClick(Map<String, Object> parameters) {
- MouseEventDetails mouseDetails = MouseEventDetails
- .deSerialize((String) parameters.get("mouseDetails"));
- Component childComponent = (Component) parameters.get("component");
-
- fireEvent(new LayoutClickEvent(this, mouseDetails, childComponent));
- }
-
- /**
- * Add a click listener to the layout. The listener is called whenever the
- * user clicks inside the layout. Also when the click targets a component
- * inside the Panel, provided the targeted component does not prevent the
- * click event from propagating.
- *
- * The child component that was clicked is included in the
- * {@link LayoutClickEvent}.
- *
- * Use {@link #removeListener(LayoutClickListener)} to remove the listener.
- *
- * @param listener
- * The listener to add
- */
public void addListener(LayoutClickListener listener) {
addListener(CLICK_EVENT, LayoutClickEvent.class, listener,
LayoutClickListener.clickMethod);
}
- /**
- * Remove a click listener from the layout. The listener should earlier have
- * been added using {@link #addListener(LayoutClickListener)}.
- *
- * @param listener
- * The listener to remove
- */
public void removeListener(LayoutClickListener listener) {
removeListener(CLICK_EVENT, LayoutClickEvent.class, listener);
}