summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-11-29 19:56:43 +0200
committerVaadin Code Review <review@vaadin.com>2012-12-05 09:59:11 +0000
commit971a88f8102060e30139b86b0bd8ff86b72b692b (patch)
tree6c8a0d53c7ca80ade612b18ef869aa7bb7d76b0f
parentcf48970096f0321321cee30cfdee91ef0b640e23 (diff)
downloadvaadin-framework-971a88f8102060e30139b86b0bd8ff86b72b692b.tar.gz
vaadin-framework-971a88f8102060e30139b86b0bd8ff86b72b692b.zip
Moved hasEventListener to ServerConnector (#10433)
Change-Id: I1223c8ece8951b69b540979ef6f782dc292d31e0
-rw-r--r--client/src/com/vaadin/client/ComponentConnector.java2
-rw-r--r--client/src/com/vaadin/client/ServerConnector.java12
-rw-r--r--client/src/com/vaadin/client/ui/AbstractComponentConnector.java18
-rw-r--r--client/src/com/vaadin/client/ui/AbstractConnector.java11
4 files changed, 24 insertions, 19 deletions
diff --git a/client/src/com/vaadin/client/ComponentConnector.java b/client/src/com/vaadin/client/ComponentConnector.java
index ae889c1dbd..63e55153b6 100644
--- a/client/src/com/vaadin/client/ComponentConnector.java
+++ b/client/src/com/vaadin/client/ComponentConnector.java
@@ -94,8 +94,6 @@ public interface ComponentConnector extends ServerConnector {
@Deprecated
public boolean isReadOnly();
- public boolean hasEventListener(String eventIdentifier);
-
/**
* Return true if parent handles caption, false if the paintable handles the
* caption itself.
diff --git a/client/src/com/vaadin/client/ServerConnector.java b/client/src/com/vaadin/client/ServerConnector.java
index c5f42d3bd0..2ff2cb5ab5 100644
--- a/client/src/com/vaadin/client/ServerConnector.java
+++ b/client/src/com/vaadin/client/ServerConnector.java
@@ -179,4 +179,16 @@ public interface ServerConnector extends Connector {
* {@link SharedState}. Never null.
*/
public SharedState getState();
+
+ /**
+ * Checks if an event listener has been registered on the server side for
+ * the given event identifier.
+ *
+ * @param eventIdentifier
+ * The identifier for the event
+ * @return true if a listener has been registered on the server side, false
+ * otherwise
+ */
+ public boolean hasEventListener(String eventIdentifier);
+
}
diff --git a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java
index cda6e8f369..16b5adef81 100644
--- a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java
+++ b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java
@@ -17,7 +17,6 @@ package com.vaadin.client.ui;
import java.util.ArrayList;
import java.util.List;
-import java.util.Set;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.Focusable;
@@ -25,8 +24,8 @@ import com.google.gwt.user.client.ui.HasEnabled;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.ComponentConnector;
-import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.ConnectorMap;
+import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.LayoutManager;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.StyleConstants;
@@ -391,21 +390,6 @@ public abstract class AbstractComponentConnector extends AbstractConnector
return LayoutManager.get(getConnection());
}
- /**
- * Checks if there is a registered server side listener for the given event
- * identifier.
- *
- * @param eventIdentifier
- * The identifier to check for
- * @return true if an event listener has been registered with the given
- * event identifier on the server side, false otherwise
- */
- @Override
- public boolean hasEventListener(String eventIdentifier) {
- Set<String> reg = getState().registeredEventListeners;
- return (reg != null && reg.contains(eventIdentifier));
- }
-
@Override
public void updateEnabledState(boolean enabledState) {
super.updateEnabledState(enabledState);
diff --git a/client/src/com/vaadin/client/ui/AbstractConnector.java b/client/src/com/vaadin/client/ui/AbstractConnector.java
index 68f09ce471..980f4c90ec 100644
--- a/client/src/com/vaadin/client/ui/AbstractConnector.java
+++ b/client/src/com/vaadin/client/ui/AbstractConnector.java
@@ -21,6 +21,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerManager;
@@ -408,4 +409,14 @@ public abstract class AbstractConnector implements ServerConnector,
return urlReference.getURL();
}
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.client.ServerConnector#hasEventListener(java.lang.String)
+ */
+ public boolean hasEventListener(String eventIdentifier) {
+ Set<String> reg = getState().registeredEventListeners;
+ return (reg != null && reg.contains(eventIdentifier));
+ }
}