Skip to content
Snippets Groups Projects

4014

Merged 4014
1 unresolved thread
Merged Andreas Bayha requested to merge 4014 into master
1 unresolved thread
3 files
+ 33
6
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -86,6 +86,12 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
/** Option text for the annotation type filter combo box. */
private static final String SHOW_ALL_ANNOTATION_TYPES = "Show all annotation types";
/**
* Root element to be added to the tree viewer (but not displayed). Container for all
* {@link AnnotationEntry}s.
*/
ArtificialRoot root = new ArtificialRoot();
/** {@link TextField} for entering the filter pattern. */
@FXML
private TextField txtFilterText;
@@ -227,16 +233,16 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
listElements.add((IModelElement)curentRootElement);
}
ArtificialRoot rootElement = new ArtificialRoot();
root = new ArtificialRoot();
for(IModelElement elem : listElements) {
AnnotationEntry entry = IAnnotationValueService.getInstance().getAnnotationEntry(elem);
if(entry != null && !entry.getSpecificationsList().isEmpty()) {
rootElement.elements.add(entry);
root.elements.add(entry);
}
}
sort(rootElement.elements);
sort(root.elements);
Set<AnnotationEntry> annotationEntries = new HashSet<>();
listElements.forEach(e -> annotationEntries
@@ -260,7 +266,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
new AnnotationTreeTableUIProvider();
annotationViewer = new DynamicTreeTableViewer<AnnotationEntry>(annotationTreeTableView,
rootElement, showRoot, revealLevel, filterContentProvider, uiProvider);
root, showRoot, revealLevel, filterContentProvider, uiProvider);
annotationViewer.addColumn("Model Element", 200);
annotationViewer.addColumn("Comment", 250);
@@ -542,6 +548,25 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
return false;
}
/** {@inheritDoc} */
@Override
public boolean isEditable(int column) {
// The first two columns are not supposed to be editable.
if(column <= 1) {
return false;
}
for(AnnotationEntry ae : root.elements) {
// If any cell is editable in this column, the column is editable.
if(isEditable(column, ae)) {
return true;
}
}
return false;
}
}
/**
Loading