fixing #5115
authorKatja Luther <k.luther@bgbm.org>
Tue, 10 Nov 2015 08:31:15 +0000 (09:31 +0100)
committerKatja Luther <k.luther@bgbm.org>
Tue, 10 Nov 2015 08:31:15 +0000 (09:31 +0100)
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java

index 8281fca55730c8e4d81a2fa766ff092f498fea7d..55c9c006b7565d7affc579117b18ac9f03a0db96 100644 (file)
@@ -161,4 +161,5 @@ commandParameter.name = taxonUUID
 Bundle-Name = Editor Bundle\r
 command.name.48 = delete\r
 command.name.49 = delete\r
 Bundle-Name = Editor Bundle\r
 command.name.48 = delete\r
 command.name.49 = delete\r
-command.name.50 = delete
\ No newline at end of file
+command.name.50 = delete\r
+command.name.51 = delete
\ No newline at end of file
index e227ad70215e3984cde83cec502747a800545840..b542b5adaa08b3a4277195363034a7a31daf9eab 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
             name="%command.name.33">
       </command>
             id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
             name="%command.name.33">
       </command>
+      <command
+            categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.DeleteConceptHandler"
+            id="eu.etaxonomy.taxeditor.editor.view.concept.command.delete"
+            name="%command.name.51">
+      </command>
       <category
             id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
             name="%category.name.7">
       <category
             id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
             name="%category.name.7">
index 6a2038534709ea63958236e57366fcd948d9a4a6..d536c866b283403f275e0ba50a9c2cf220bf3a52 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
@@ -41,6 +42,15 @@ public class DeleteTermBaseHandler extends AbstractHandler {
                DefinedTermEditor editor = (DefinedTermEditor) HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
                DefinedTermEditor editor = (DefinedTermEditor) HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
+               if (editor.isDirty()){\r
+                       boolean proceed = MessageDialog.openQuestion(null,\r
+                                       "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");\r
+                       if (proceed) {\r
+                               editor.doSave(null);\r
+                       } else {\r
+                               return null;\r
+                       }\r
+               }\r
                if (editor instanceof DefinedTermEditor){\r
                        DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
                        try {\r
                if (editor instanceof DefinedTermEditor){\r
                        DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
                        try {\r