]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove DataSource.indexOf (#16542)
authorLeif Åstrand <leif@vaadin.com>
Fri, 30 Jan 2015 15:07:51 +0000 (17:07 +0200)
committerLeif Åstrand <leif@vaadin.com>
Mon, 2 Feb 2015 17:46:06 +0000 (19:46 +0200)
This change makes it easier to create custom data sources. The
implementations in provided implementations are retained as a
convenience.

Change-Id: If34bfb378eec75a37f28af78e512210ed9d7c304

client/src/com/vaadin/client/data/AbstractRemoteDataSource.java
client/src/com/vaadin/client/data/DataSource.java
client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java
uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java

index 0ad1631e1907e12059bdbee0f28991845f95b094..bd676e4ee95540a264295f3d875de6e00265faab 100644 (file)
@@ -362,7 +362,16 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> {
         return indexToRowMap.get(Integer.valueOf(rowIndex));
     }
 
-    @Override
+    /**
+     * Retrieves the index for given row object.
+     * <p>
+     * <em>Note:</em> 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 <code>-1</code> if row is not available
+     */
     public int indexOf(T row) {
         Object key = getRowKey(row);
         if (keyToIndexMap.containsKey(key)) {
index 076226bf5cf4cbf54566e8cd413e80a89789fbd5..f3711c3c68e1123576497f03c5d8648ed42ada68 100644 (file)
@@ -194,16 +194,4 @@ public interface DataSource<T> {
      *        means that the row is not currently in this data source's cache.
      */
     public RowHandle<T> getHandle(T row);
-
-    /**
-     * Retrieves the index for given row object.
-     * <p>
-     * <em>Note:</em> 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 <code>-1</code> if row is not available
-     */
-    int indexOf(T row);
 }
index 56e1db5c361ba94670c721528c8b2f1098410d6b..47e072490ed2a3a6277f2958f8bd62cb11e479a8 100644 (file)
@@ -443,7 +443,16 @@ public class ListDataSource<T> implements DataSource<T> {
         }
     }
 
-    @Override
+    /**
+     * Retrieves the index for given row object.
+     * <p>
+     * <em>Note:</em> 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 <code>-1</code> if row is not available
+     */
     public int indexOf(T row) {
         return ds.indexOf(row);
     }
index f35f9820e012fef44fae37f575e76b41b743b7f1..2b8f454ed1c97da951d6f5e10dc7e67a78d44a46 100644 (file)
@@ -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