]> gerrit.simantics Code Review - simantics/district.git/blob - RowHeaderTableDataProvider.java
b85f6e37205721199e4ada60fa09c47bdca82b71
[simantics/district.git] / RowHeaderTableDataProvider.java
1 package org.simantics.district.network.ui.table;
2
3 import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
4
5 public class RowHeaderTableDataProvider implements IDataProvider {
6
7     protected final IDataProvider bodyDataProvider;
8
9     public RowHeaderTableDataProvider(IDataProvider bodyDataProvider) {
10         this.bodyDataProvider = bodyDataProvider;
11     }
12
13     @Override
14     public int getColumnCount() {
15         return 1;
16     }
17
18     @Override
19     public int getRowCount() {
20         return this.bodyDataProvider.getRowCount();
21     }
22
23     @Override
24     public Object getDataValue(int columnIndex, int rowIndex) {
25         return Integer.valueOf(rowIndex + 1);
26     }
27
28     @Override
29     public void setDataValue(int columnIndex, int rowIndex, Object newValue) {
30         throw new UnsupportedOperationException();
31     }
32
33 }