]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/commands/DeleteAkbNodes.java
fix a few post refactoring UI Bugs
[gpl/argeo-slc.git] / plugins / org.argeo.slc.akb.ui / src / main / java / org / argeo / slc / akb / ui / commands / DeleteAkbNodes.java
index 9889ae00e22cb3e758e2992ae2b9b79ed6944eed..2faafa38b7ba88937d1ff8893058afffd5950437 100644 (file)
@@ -9,6 +9,7 @@ import org.argeo.jcr.JcrUtils;
 import org.argeo.slc.akb.AkbException;
 import org.argeo.slc.akb.ui.AkbUiPlugin;
 import org.argeo.slc.akb.ui.editors.AkbNodeEditorInput;
+import org.argeo.slc.akb.utils.AkbJcrUtils;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -47,8 +48,12 @@ public class DeleteAkbNodes extends AbstractHandler {
                        if (nodeJcrId != null)
                                node = session.getNodeByIdentifier(nodeJcrId);
 
+                       // We must be in a template to delete nodes...
+                       Node template = AkbJcrUtils.getCurrentTemplate(node);
+
                        IEditorPart currPart = currentPage
-                                       .findEditor(new AkbNodeEditorInput(nodeJcrId));
+                                       .findEditor(new AkbNodeEditorInput(
+                                                       template.getIdentifier(), nodeJcrId));
                        if (currPart != null)
                                currPart.dispose();