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:
1.1 KB
|
Line | |
---|
1 | package com.framsticks.gui.table; |
---|
2 | |
---|
3 | import com.framsticks.gui.controls.ProcedureControl; |
---|
4 | import com.framsticks.params.CompositeParam; |
---|
5 | import com.framsticks.params.types.ProcedureParam; |
---|
6 | import com.framsticks.structure.Path; |
---|
7 | |
---|
8 | import static com.framsticks.params.ParamsUtil.arguments; |
---|
9 | |
---|
10 | public class ProcedureColumn extends Column { |
---|
11 | |
---|
12 | public ProcedureColumn(ProcedureParam param, TableModel tableModel) { |
---|
13 | super(param, tableModel); |
---|
14 | } |
---|
15 | |
---|
16 | @Override |
---|
17 | public ProcedureParam getParam() { |
---|
18 | return (ProcedureParam) param; |
---|
19 | } |
---|
20 | |
---|
21 | @Override |
---|
22 | public Class<?> getColumnClass() { |
---|
23 | return ProcedureParam.class; |
---|
24 | } |
---|
25 | |
---|
26 | @Override |
---|
27 | public Object getValueAt(int rowIndex) { |
---|
28 | return param; |
---|
29 | } |
---|
30 | |
---|
31 | @Override |
---|
32 | public int setValueAt(int rowIndex, Object value) { |
---|
33 | CompositeParam param = tableModel.getAccess().getCompositeParam(rowIndex); |
---|
34 | if (param == null) { |
---|
35 | return 0; |
---|
36 | } |
---|
37 | Path path = tableModel.getListPanel().getCurrentPath().appendParam(param).tryFindResolution(); |
---|
38 | if (!path.isResolved()) { |
---|
39 | return 0; |
---|
40 | } |
---|
41 | ProcedureControl.callProcedure(path, getParam(), arguments(), tableModel.getFrame()); |
---|
42 | return 0; |
---|
43 | } |
---|
44 | |
---|
45 | @Override |
---|
46 | public boolean isEditable() { |
---|
47 | return true; |
---|
48 | } |
---|
49 | |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.