1
2
3
4
5 package de.mindcrimeilab.xsanalyzer.model;
6
7 import javax.swing.tree.TreePath;
8
9 import org.springframework.binding.value.support.AbstractValueModelWrapper;
10
11
12
13
14
15
16
17 public final class JTreeValueModelAdapter extends AbstractValueModelWrapper {
18
19 public JTreeValueModelAdapter(TreeSelectionValueModelAdapter valueModel) {
20 super(valueModel);
21 }
22
23 @Override
24 public Object getValue() {
25 TreePath[] path = (TreePath[]) getInnerMostWrappedValueModel().getValue();
26 Object[] result = new Object[path.length];
27 for (int i = 0; i < path.length; ++i) {
28 result[i] = path[i].getLastPathComponent();
29 }
30
31 return result;
32 }
33 }