Revision 1546bd75
Added by Katja Luther over 3 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java | ||
---|---|---|
147 | 147 |
} |
148 | 148 |
|
149 | 149 |
private FeatureNodeContainerTree getContainerTreeForDesription(DescriptionBase<?> description){ |
150 |
// if(! featureNodeContainerCache.containsKey(description)){
|
|
151 |
// FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, getFeatureTree(description));
|
|
152 |
// featureNodeContainerCache.put(description, containerTree);
|
|
153 |
// }
|
|
154 |
// return featureNodeContainerCache.get(description);
|
|
155 |
return new FeatureNodeContainerTree(description, getFeatureTree(description));
|
|
150 |
if(! featureNodeContainerCache.containsKey(description)){ |
|
151 |
FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, getFeatureTree(description)); |
|
152 |
featureNodeContainerCache.put(description, containerTree); |
|
153 |
} |
|
154 |
return featureNodeContainerCache.get(description); |
|
155 |
// return
|
|
156 | 156 |
} |
157 | 157 |
|
158 | 158 |
@Override |
... | ... | |
176 | 176 |
* @param description |
177 | 177 |
* @return |
178 | 178 |
*/ |
179 |
private TermTree getFeatureTree(DescriptionBase description){
|
|
179 |
public TermTree getFeatureTree(DescriptionBase description){
|
|
180 | 180 |
|
181 | 181 |
TermTree<?> featureTree = null; |
182 | 182 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java | ||
---|---|---|
209 | 209 |
DescriptionBase description = descriptionElement.getInDescription(); |
210 | 210 |
FeatureNodeContainerTree containerTree = featureNodeContainerCache.get(description); |
211 | 211 |
FeatureNodeContainer featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement); |
212 |
if (featureNodeContainer == null){ |
|
213 |
containerTree = new FeatureNodeContainerTree(description, provider.getFeatureTree(description)); |
|
214 |
featureNodeContainerCache.put(description, containerTree); |
|
215 |
featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement); |
|
216 |
} |
|
212 | 217 |
((AbstractTreeViewer) viewer).expandToLevel(featureNodeContainer, 2); |
213 | 218 |
StructuredSelection selection = new StructuredSelection(object); |
214 | 219 |
viewer.setSelection(selection, true); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java | ||
---|---|---|
69 | 69 |
|
70 | 70 |
// add possible children to the menu |
71 | 71 |
for (TermNode<?> childNode : featureNode.getChildNodes()) { |
72 |
createMenuItem(menu, childNode.getTerm(), globalLanguage); |
|
72 |
TermTree<?> featureTree = getFeatureTree(((FeatureNodeContainer) selectedElement).getDescription()); |
|
73 |
featureTree = PreferencesUtil.getPreferredFeatureTreeForNameDescription(false); |
|
74 |
|
|
75 |
if (featureTree != null && featureTree.getRootChildren().contains(childNode.getTerm() )){ |
|
76 |
createMenuItem(menu, childNode.getTerm(), globalLanguage); |
|
77 |
} |
|
73 | 78 |
} |
79 |
|
|
74 | 80 |
} else if (selectedElement instanceof DescriptionElementBase) { |
75 | 81 |
Feature feature = ((DescriptionElementBase) selectedElement) |
76 | 82 |
.getFeature(); |
Also available in: Unified diff
smaller changes for feature tree handling in factual data view