summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/data/util/AbstractProperty.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/data/util/AbstractProperty.java')
-rw-r--r--src/com/vaadin/data/util/AbstractProperty.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/vaadin/data/util/AbstractProperty.java b/src/com/vaadin/data/util/AbstractProperty.java
index 2b3fcf2c93..953ab664a3 100644
--- a/src/com/vaadin/data/util/AbstractProperty.java
+++ b/src/com/vaadin/data/util/AbstractProperty.java
@@ -1,5 +1,7 @@
package com.vaadin.data.util;
+import java.util.Collection;
+import java.util.Collections;
import java.util.LinkedList;
import com.vaadin.data.Property;
@@ -191,4 +193,24 @@ public abstract class AbstractProperty implements Property,
}
}
+ public Collection<?> getListeners(Class<?> eventType) {
+ if (Property.ValueChangeEvent.class.isAssignableFrom(eventType)) {
+ if (valueChangeListeners == null) {
+ return Collections.EMPTY_LIST;
+ } else {
+ return Collections.unmodifiableCollection(valueChangeListeners);
+ }
+ } else if (Property.ReadOnlyStatusChangeEvent.class
+ .isAssignableFrom(eventType)) {
+ if (readOnlyStatusChangeListeners == null) {
+ return Collections.EMPTY_LIST;
+ } else {
+ return Collections
+ .unmodifiableCollection(readOnlyStatusChangeListeners);
+ }
+ }
+
+ return Collections.EMPTY_LIST;
+ }
+
}