aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-10-28 13:48:34 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-10-28 13:48:34 +0000
commitccd94db68dffb2e8d4562199b718325298a0e80c (patch)
tree20527c31d52391d30d8e01b9cf55b3684868bce8
parent7a0133a42a128893cb08734938c8e3b55f25aefe (diff)
downloadvaadin-framework-ccd94db68dffb2e8d4562199b718325298a0e80c.tar.gz
vaadin-framework-ccd94db68dffb2e8d4562199b718325298a0e80c.zip
added method for implementations to check if component has a listener for a specific event type. Needed e.g. for paint optimizations.
svn changeset:15762/svn branch:6.5
-rw-r--r--src/com/vaadin/ui/AbstractComponent.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java
index 061323bf22..f0938780fe 100644
--- a/src/com/vaadin/ui/AbstractComponent.java
+++ b/src/com/vaadin/ui/AbstractComponent.java
@@ -941,6 +941,17 @@ public abstract class AbstractComponent implements Component, MethodEventSource
}
/**
+ * Checks if the given {@link Event} type is listened for this component.
+ *
+ * @param eventType
+ * the event type to be checked
+ * @return true if a listener is registered for the given event type
+ */
+ protected boolean hasListeners(Class<?> eventType) {
+ return eventRouter != null && eventRouter.hasListeners(eventType);
+ }
+
+ /**
* Removes all registered listeners matching the given parameters. Since
* this method receives the event type and the listener object as
* parameters, it will unregister all <code>object</code>'s methods that are