Community
Participate
Working Groups
Currently, the platform uses the following patter to remove a "someElement" model element. ------ someElement.setToBeRendered(false); // Causes the rendering engine to call 'removeGui' someElement.getParent().getChildren().remove(someElement); --------- Tom suggested a long time ago, to add a EModel.deleteElement() method which does that. See https://www.eclipse.org/forums/index.php?t=msg&th=757211&goto=1371824&#msg_1371824
Tom, do you still think this method would be useful?
+1 for an API on EModelService
New Gerrit change created: https://git.eclipse.org/r/133991
(In reply to Thomas Schindl from comment #2) > +1 for an API on EModelService (In reply to Eclipse Genie from comment #3) > New Gerrit change created: https://git.eclipse.org/r/133991 Tom, is this what you had in mind?
Gerrit change https://git.eclipse.org/r/133991 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=a98ab4975e6eb898e4111418a10b76c7e00eadab
(In reply to Eclipse Genie from comment #5) > Gerrit change https://git.eclipse.org/r/133991 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=a98ab4975e6eb898e4111418a10b76c7e00eadab https://download.eclipse.org/eclipse/downloads/drops4/I20190209-1800/testresults/html/org.eclipse.releng.tests_ep411I-unit-win32-java8_win32.win32.x86_64_8.0.html Lars, this patch probably causes this error below (one from three, full list see bug 543933 comment 11) : https://download.eclipse.org/eclipse/downloads/drops4/I20190209-1800/compilelogs/platform.doc.isv.javadoc.txt ../../../eclipse.platform.ui/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java:74: error: package org.eclipse.jdt.annotation does not exist import org.eclipse.jdt.annotation.NonNull; ^ ../../../eclipse.platform.ui/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java:164: error: cannot find symbol public void deleteModelElement(@NonNull MUIElement element) { ^ symbol: class NonNull location: class ModelServiceImpl 2 errors
(In reply to Andrey Loskutov from comment #6) Thanks, Andrey. As a temporary fix I will remove the annotation. Opened Bug 544322 for the support in the Javadoc build of @NonNull.
New Gerrit change created: https://git.eclipse.org/r/136645
Gerrit change https://git.eclipse.org/r/136645 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7294452a382e31981429c2d0d8b3b1df480a7163
(In reply to Lars Vogel from comment #7) > (In reply to Andrey Loskutov from comment #6) > > Thanks, Andrey. As a temporary fix I will remove the annotation. Opened Bug > 544322 for the support in the Javadoc build of @NonNull. I don't think it is a good idea to paritially introduce @NonNull/@Nullable. Generally speaking: @NonNull is the default and @Nullable the exception (which is also true today where if not explictly stated you are not allowed to pass null).