From 45e16c7e2bc1afe3d773c84e070c476966dc8413 Mon Sep 17 00:00:00 2001 From: Petri Heinonen Date: Thu, 23 Aug 2012 09:54:02 +0300 Subject: [PATCH] refak listeners com.vaadin.data.util.sqlcontainer --- .../data/util/sqlcontainer/SQLContainer.java | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index 13248f1e06..a53f32b96e 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -1493,13 +1493,23 @@ public class SQLContainer implements Container, Container.Filterable, */ @Override - public void addListener(Container.ItemSetChangeListener listener) { + public void addItemSetChangeListener( + Container.ItemSetChangeListener listener) { if (itemSetChangeListeners == null) { itemSetChangeListeners = new LinkedList(); } itemSetChangeListeners.add(listener); } + /** + * @deprecated Since 7.0, replaced by + * {@link #addItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener)} + **/ + @Deprecated + public void addListener(Container.ItemSetChangeListener listener) { + addItemSetChangeListener(listener); + } + /* * (non-Javadoc) * @@ -1509,12 +1519,22 @@ public class SQLContainer implements Container, Container.Filterable, */ @Override - public void removeListener(Container.ItemSetChangeListener listener) { + public void removeItemSetChangeListener( + Container.ItemSetChangeListener listener) { if (itemSetChangeListeners != null) { itemSetChangeListeners.remove(listener); } } + /** + * @deprecated Since 7.0, replaced by + * {@link #removeItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener)} + **/ + @Deprecated + public void removeListener(Container.ItemSetChangeListener listener) { + removeItemSetChangeListener(listener); + } + protected void fireContentsChange() { if (itemSetChangeListeners != null) { final Object[] l = itemSetChangeListeners.toArray(); @@ -1553,25 +1573,43 @@ public class SQLContainer implements Container, Container.Filterable, * * @param listener */ - public void addListener(RowIdChangeListener listener) { + public void addRowIdChangeListener(RowIdChangeListener listener) { if (delegate instanceof QueryDelegate.RowIdChangeNotifier) { ((QueryDelegate.RowIdChangeNotifier) delegate) .addListener(listener); } } + /** + * @deprecated Since 7.0, replaced by + * {@link #addRowIdChangeListener(RowIdChangeListener)} + **/ + @Deprecated + public void addListener(RowIdChangeListener listener) { + addRowIdChangeListener(listener); + } + /** * Removes a RowIdChangeListener from the QueryDelegate * * @param listener */ - public void removeListener(RowIdChangeListener listener) { + public void removeRowIdChangeListener(RowIdChangeListener listener) { if (delegate instanceof QueryDelegate.RowIdChangeNotifier) { ((QueryDelegate.RowIdChangeNotifier) delegate) .removeListener(listener); } } + /** + * @deprecated Since 7.0, replaced by + * {@link #removeRowIdChangeListener(RowIdChangeListener)} + **/ + @Deprecated + public void removeListener(RowIdChangeListener listener) { + removeRowIdChangeListener(listener); + } + /** * Calling this will enable this SQLContainer to send and receive cache * flush notifications for its lifetime. -- 2.39.5