]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/TechTypeRowHeaderTableDataProvider.java
First testing version of TechTypeTable
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / techtype / table / TechTypeRowHeaderTableDataProvider.java
1 package org.simantics.district.network.ui.techtype.table;
2
3 import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
4
5 public class TechTypeRowHeaderTableDataProvider implements IDataProvider {
6
7     protected final IDataProvider bodyDataProvider;
8
9     public TechTypeRowHeaderTableDataProvider(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 }