}
private FeatureNodeContainerTree getContainerTreeForDesription(DescriptionBase<?> description){
-// if(! featureNodeContainerCache.containsKey(description)){
-// FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, getFeatureTree(description));
-// featureNodeContainerCache.put(description, containerTree);
-// }
-// return featureNodeContainerCache.get(description);
- return new FeatureNodeContainerTree(description, getFeatureTree(description));
+ if(! featureNodeContainerCache.containsKey(description)){
+ FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, getFeatureTree(description));
+ featureNodeContainerCache.put(description, containerTree);
+ }
+ return featureNodeContainerCache.get(description);
+// return
}
@Override
* @param description
* @return
*/
- private TermTree getFeatureTree(DescriptionBase description){
+ public TermTree getFeatureTree(DescriptionBase description){
TermTree<?> featureTree = null;
DescriptionBase description = descriptionElement.getInDescription();
FeatureNodeContainerTree containerTree = featureNodeContainerCache.get(description);
FeatureNodeContainer featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement);
+ if (featureNodeContainer == null){
+ containerTree = new FeatureNodeContainerTree(description, provider.getFeatureTree(description));
+ featureNodeContainerCache.put(description, containerTree);
+ featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement);
+ }
((AbstractTreeViewer) viewer).expandToLevel(featureNodeContainer, 2);
StructuredSelection selection = new StructuredSelection(object);
viewer.setSelection(selection, true);
// add possible children to the menu
for (TermNode<?> childNode : featureNode.getChildNodes()) {
- createMenuItem(menu, childNode.getTerm(), globalLanguage);
+ TermTree<?> featureTree = getFeatureTree(((FeatureNodeContainer) selectedElement).getDescription());
+ featureTree = PreferencesUtil.getPreferredFeatureTreeForNameDescription(false);
+
+ if (featureTree != null && featureTree.getRootChildren().contains(childNode.getTerm() )){
+ createMenuItem(menu, childNode.getTerm(), globalLanguage);
+ }
}
+
} else if (selectedElement instanceof DescriptionElementBase) {
Feature feature = ((DescriptionElementBase) selectedElement)
.getFeature();