Revision f4fd193c
Added by Niels Hoffmann about 13 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyContentProvider.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
20 | 20 |
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode; |
21 |
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship; |
|
21 | 22 |
|
22 | 23 |
/** |
23 | 24 |
* |
... | ... | |
56 | 57 |
if (parent instanceof PolytomousKeyNode) { |
57 | 58 |
children = ((PolytomousKeyNode) parent).getChildren(); |
58 | 59 |
} else if (parent instanceof PolytomousKey) { |
59 |
children = ((PolytomousKey) parent).getRoot().getChildren(); |
|
60 |
children = new ArrayList<PolytomousKeyNode>(); |
|
61 |
children.add(((PolytomousKey) parent).getRoot()); |
|
60 | 62 |
} else { |
61 | 63 |
throw new RuntimeException( |
62 | 64 |
"Parent element has to be PolytomousKeyNode or PolytomousKey, but was: " |
... | ... | |
71 | 73 |
|
72 | 74 |
@Override |
73 | 75 |
public Object getSource(Object relationship) { |
74 |
return ((PolytomousKeyRelationship) relationship).source;
|
|
76 |
return ((PolytomousKeyRelationship) relationship).getSource();
|
|
75 | 77 |
} |
76 | 78 |
|
77 | 79 |
@Override |
78 | 80 |
public Object getDestination(Object relationship) { |
79 |
return ((PolytomousKeyRelationship) relationship).destination;
|
|
81 |
return ((PolytomousKeyRelationship) relationship).getDestination();
|
|
80 | 82 |
} |
81 | 83 |
|
82 | 84 |
} |
Also available in: Unified diff
Improving polytomous key handling