summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-01-30 17:07:51 +0200
committerVaadin Code Review <review@vaadin.com>2015-02-02 10:01:39 +0000
commitc2225299f9bf7a145c427bc204272faf5bc3f6d3 (patch)
treedebe1d90afd2b5e00ac0773f4eec5707ff9d1378
parente052d648749312225098093a53dc7a19ea870cfd (diff)
downloadvaadin-framework-c2225299f9bf7a145c427bc204272faf5bc3f6d3.tar.gz
vaadin-framework-c2225299f9bf7a145c427bc204272faf5bc3f6d3.zip
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
-rw-r--r--client/src/com/vaadin/client/data/AbstractRemoteDataSource.java11
-rw-r--r--client/src/com/vaadin/client/data/DataSource.java12
-rw-r--r--client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java11
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java5
4 files changed, 20 insertions, 19 deletions
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<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)) {
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<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);
}
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<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);
}
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