This change makes it easier to create custom data sources. The implementations in provided implementations are retained as a convenience. Change-Id: If34bfb378eec75a37f28af78e512210ed9d7c304tags/7.4.0.rc1
@@ -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)) { |
@@ -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); | |||
} |
@@ -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); | |||
} |
@@ -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 |