Browse Source

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
tags/7.4.0.rc1
Leif Åstrand 9 years ago
parent
commit
3a6341239f

+ 10
- 1
client/src/com/vaadin/client/data/AbstractRemoteDataSource.java View 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)) {

+ 0
- 12
client/src/com/vaadin/client/data/DataSource.java View 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);
}

+ 10
- 1
client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java View 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);
}

+ 0
- 5
uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java View 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

Loading…
Cancel
Save