diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java index 3acca7e9fc439cdc5d1fe5ec81a68d7867778d3e..b1b158dfa745f7bdb368dacd9f73eaa21d2a71df 100644 --- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java +++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java @@ -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; + } } /** diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings index a973120c509887bc315615f805e9b767f84205cf..121a6f1dc733cc39a2096a5b6cdb78eb3120cf08 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings @@ -1,4 +1,4 @@ -ErrorViewFXLayoutController.java 382b8014acf4b0c625817d6279dfcdd670296cb2 GREEN +ErrorViewFXLayoutController.java 5549b928801393c169983c116c5a23aa19b3e291 YELLOW ErrorViewFXViewPart.java f620022aef647d7a019be8afc5351fabde05dcee GREEN MarkerViewFXContentProvider.java ecf92449414b2b8648ad151bc932189baa23dc12 GREEN MarkerViewFXUIProvider.java c5719d95ac7bd5605fff65d6150eca8b9ca6fc02 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java index 382b8014acf4b0c625817d6279dfcdd670296cb2..5549b928801393c169983c116c5a23aa19b3e291 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java @@ -117,7 +117,9 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, /** Refreshes the tree table. */ public void refresh() { - treeTable.update(); + if(treeTable != null) { + treeTable.update(); + } } /** {@inheritDoc} */