diff options
Diffstat (limited to 'shared/src')
3 files changed, 13 insertions, 26 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/communication/SharedState.java b/shared/src/main/java/com/vaadin/shared/communication/SharedState.java index 872327e8fd..fd9a3ce0bd 100644 --- a/shared/src/main/java/com/vaadin/shared/communication/SharedState.java +++ b/shared/src/main/java/com/vaadin/shared/communication/SharedState.java @@ -19,6 +19,7 @@ package com.vaadin.shared.communication; import java.io.Serializable; import java.util.HashMap; import java.util.Map; +import java.util.Set; import com.vaadin.shared.Connector; import com.vaadin.shared.annotations.NoLayout; @@ -63,12 +64,9 @@ public class SharedState implements Serializable { public boolean enabled = true; /** - * A Map of event identifiers with registered listeners, {@code key} is - * event identifier, {@code value} is the listeners count. - * - * @since 8.2 + * A set of event identifiers with registered listeners. */ @NoLayout - public Map<String, Integer> registeredEventListeners; + public Set<String> registeredEventListeners; } diff --git a/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java index a2f6618b9e..0ef247353b 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java @@ -16,7 +16,7 @@ package com.vaadin.shared.ui; import java.io.Serializable; -import java.util.HashMap; +import java.util.HashSet; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.Registration; @@ -67,19 +67,12 @@ public final class ComponentStateUtil implements Serializable { @Deprecated public static final void removeRegisteredEventListener(SharedState state, String eventIdentifier) { - if (state.registeredEventListeners != null) { - Integer count = state.registeredEventListeners.get(eventIdentifier); - if (count != null) { - if (count > 1) { - state.registeredEventListeners.put(eventIdentifier, - count - 1); - } else { - state.registeredEventListeners.remove(eventIdentifier); - if (state.registeredEventListeners.isEmpty()) { - state.registeredEventListeners = null; - } - } - } + if (state.registeredEventListeners == null) { + return; + } + state.registeredEventListeners.remove(eventIdentifier); + if (state.registeredEventListeners.size() == 0) { + state.registeredEventListeners = null; } } @@ -94,13 +87,9 @@ public final class ComponentStateUtil implements Serializable { public static final Registration addRegisteredEventListener( SharedState state, String eventListenerId) { if (state.registeredEventListeners == null) { - state.registeredEventListeners = new HashMap<>(); - } - Integer count = state.registeredEventListeners.get(eventListenerId); - if (count == null) { - count = 0; + state.registeredEventListeners = new HashSet<>(); } - state.registeredEventListeners.put(eventListenerId, count + 1); + state.registeredEventListeners.add(eventListenerId); return () -> removeRegisteredEventListener(state, eventListenerId); } } diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java index eb0e28dce9..652db0c1bf 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java @@ -80,6 +80,6 @@ public class ColumnState extends AbstractGridExtensionState { * * @since 8.2 */ - public ContentMode contentMode; + public ContentMode tooltipContentMode; } |