ref #5995 allow a new search in bulk editor without saving
authorKatja Luther <k.luther@bgbm.org>
Mon, 22 Aug 2016 10:19:31 +0000 (12:19 +0200)
committerKatja Luther <k.luther@bgbm.org>
Mon, 22 Aug 2016 10:19:31 +0000 (12:19 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java

index 6ff1cf0..f676cce 100644 (file)
@@ -270,11 +270,14 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
 
                        // TODO check if dirty, prompt save
                        if (isDirty()) {
-                               boolean proceed = MessageDialog.openQuestion(getEditorSite().getShell(),
-                                               "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
-                               if (proceed) {
+                               String[] labels = {"Save (and Search)", "Don't save (and Search)","Cancel"};
+                               MessageDialog dialog =new MessageDialog(getEditorSite().getShell(), "Save changes", null, "You have made changes that must be saved before this query can be executed. Would you like to proceed?", MessageDialog.QUESTION,labels, 0);
+                               int result = dialog.open();
+                                               //MessageDialog.openQuestion(getEditorSite().getShell(),
+                                               //"Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
+                               if (result == 0) {
                                        doSave(null);
-                               } else {
+                               } else if (result == 2){
                                        return;
                                }
                        }