Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
954 bytes
|
Line | |
---|
1 | package com.framsticks.gui.table; |
---|
2 | |
---|
3 | import com.framsticks.params.PrimitiveParam; |
---|
4 | import com.framsticks.util.FramsticksUnsupportedOperationException; |
---|
5 | |
---|
6 | public class PrimitiveColumn extends Column { |
---|
7 | |
---|
8 | public PrimitiveColumn(PrimitiveParam<?> param, TableModel tableModel) { |
---|
9 | super(param, tableModel); |
---|
10 | } |
---|
11 | |
---|
12 | @Override |
---|
13 | public PrimitiveParam<?> getParam() { |
---|
14 | return (PrimitiveParam<?>) param; |
---|
15 | } |
---|
16 | |
---|
17 | @Override |
---|
18 | public Class<?> getColumnClass() { |
---|
19 | return getParam().getStorageType(); |
---|
20 | } |
---|
21 | |
---|
22 | @Override |
---|
23 | public Object getValueAt(int rowIndex) { |
---|
24 | Object object = tableModel.getAccess().get(rowIndex, Object.class); |
---|
25 | if (object == null) { |
---|
26 | return null; |
---|
27 | } |
---|
28 | return tableModel.getElementAccess().select(object).get(getParam(), Object.class); |
---|
29 | } |
---|
30 | |
---|
31 | @Override |
---|
32 | public int setValueAt(int rowIndex, Object value) { |
---|
33 | throw new FramsticksUnsupportedOperationException().msg("setting value in table"); |
---|
34 | } |
---|
35 | |
---|
36 | @Override |
---|
37 | public boolean isEditable() { |
---|
38 | return false; |
---|
39 | } |
---|
40 | |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.