From: Leif Åstrand Date: Fri, 30 Jan 2015 15:07:51 +0000 (+0200) Subject: Remove DataSource.indexOf (#16542) X-Git-Tag: 7.4.0.rc1~51 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3a6341239fb9a026f52ebf294f321ee1b7d106b7;p=vaadin-framework.git Remove DataSource.indexOf (#16542) This change makes it easier to create custom data sources. The implementations in provided implementations are retained as a convenience. Change-Id: If34bfb378eec75a37f28af78e512210ed9d7c304 --- diff --git a/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java index 0ad1631e19..bd676e4ee9 100644 --- a/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java +++ b/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java @@ -362,7 +362,16 @@ public abstract class AbstractRemoteDataSource implements DataSource { return indexToRowMap.get(Integer.valueOf(rowIndex)); } - @Override + /** + * Retrieves the index for given row object. + *

+ * Note: This method does not verify that the given row object + * exists at all in this DataSource. + * + * @param row + * the row object + * @return index of the row; or -1 if row is not available + */ public int indexOf(T row) { Object key = getRowKey(row); if (keyToIndexMap.containsKey(key)) { diff --git a/client/src/com/vaadin/client/data/DataSource.java b/client/src/com/vaadin/client/data/DataSource.java index 076226bf5c..f3711c3c68 100644 --- a/client/src/com/vaadin/client/data/DataSource.java +++ b/client/src/com/vaadin/client/data/DataSource.java @@ -194,16 +194,4 @@ public interface DataSource { * means that the row is not currently in this data source's cache. */ public RowHandle getHandle(T row); - - /** - * Retrieves the index for given row object. - *

- * Note: This method does not verify that the given row object - * exists at all in this DataSource. - * - * @param row - * the row object - * @return index of the row; or -1 if row is not available - */ - int indexOf(T row); } diff --git a/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java b/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java index 56e1db5c36..47e072490e 100644 --- a/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java +++ b/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java @@ -443,7 +443,16 @@ public class ListDataSource implements DataSource { } } - @Override + /** + * Retrieves the index for given row object. + *

+ * Note: This method does not verify that the given row object + * exists at all in this DataSource. + * + * @param row + * the row object + * @return index of the row; or -1 if row is not available + */ public int indexOf(T row) { return ds.indexOf(row); } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java index f35f9820e0..2b8f454ed1 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java @@ -114,11 +114,6 @@ public class GridClientColumnRendererConnector extends // TODO Auto-generated method stub (henrik paul: 17.6.) return null; } - - @Override - public int indexOf(String row) { - return ds.indexOf(row); - } } @Override