- dataModel = new ExtendedTableDataModel<Capital>(new DataProvider<Capital>() {
- private static final long serialVersionUID = 5054087821033164847L;
- public Capital getItemByKey(Object key) {
- for (Capital c : capitals) {
- if (key.equals(getKey(c))) {
- System.out.println("getItemByKey: " + key + "=" + c);
- return c;
- }
- }
- return null;
- }
- public List<Capital> getItemsByRange(int firstRow, int endRow) {
- return capitals.subList(firstRow, endRow);
- }
- public Object getKey(Capital item) {
- System.out.println("getKey: " + item.getName());
- return item.getName();
- }
- public int getRowCount() {
- return capitals.size();
- }
- });
![Public paste Public paste](/img/lock_open.png)
By: _eMaX_ | Date: Dec 10 2009 16:36 | Format: None | Expires: never | Size: 884 B | Hits: 870
Latest pastes
4 days ago
9 days ago
11 days ago
13 days ago
13 days ago