minor changes for #4657
authorKatja Luther <k.luther@bgbm.org>
Fri, 1 Apr 2016 09:28:43 +0000 (11:28 +0200)
committerKatja Luther <k.luther@bgbm.org>
Fri, 1 Apr 2016 09:28:43 +0000 (11:28 +0200)
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java

index 420eaf0b189ad65fc6a3b5c1497af8be9b563f16..02d13bd9f53d8fa14b656bf06fcfbe75e91727d9 100644 (file)
@@ -136,7 +136,7 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 
                        } else if (t != null && ("Widget is disposed".equals(t.getMessage()))){
                     MessagingUtils.warn(this.getClass(), t);
 
                        } else if (t != null && ("Widget is disposed".equals(t.getMessage()))){
                     MessagingUtils.warn(this.getClass(), t);
-                    if (PreferencesUtil.isDebugMode()){
+                    if (PreferencesUtil.isShowUpWidgetIsDisposedMessages()){
                         MessagingUtils.errorDialog("Widget is disposed",
                                 null,
                                 MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
                         MessagingUtils.errorDialog("Widget is disposed",
                                 null,
                                 MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java
new file mode 100644 (file)
index 0000000..328f861
--- /dev/null
@@ -0,0 +1,44 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author k.luther
+ * @date 01.04.2016
+ *
+ */
+public class DebugPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+     */
+    @Override
+    public void init(IWorkbench workbench) {
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+     */
+    @Override
+    protected void createFieldEditors() {
+        addField(new BooleanFieldEditor(IPreferenceKeys.IS_SHOW_UP_WIDGET_IS_DISPOSED,
+                "Show up widget is disposed error messages.",
+                getFieldEditorParent()));
+
+    }
+
+}
index d5f75d80740b9b00821dab5772d8d1b3ecde427d..884cb678f6eabfd993999ac8e6a22b8af63008f4 100644 (file)
@@ -155,7 +155,7 @@ public interface IPreferenceKeys {
 
     public static final String DEFAULT_LANGUAGE_EDITOR = "eu.etaxonomy.taxeditor.default.language";
 
 
     public static final String DEFAULT_LANGUAGE_EDITOR = "eu.etaxonomy.taxeditor.default.language";
 
-    public static final String IS_DEBUG_MODE = "eu.etaxonomy.taxeditor.idDebugMode";
+    public static final String IS_SHOW_UP_WIDGET_IS_DISPOSED = "eu.etaxonomy.taxeditor.isShowUpWidgetIsDisposed";
 
     /**
      * Key for the saved P2 repositories
 
     /**
      * Key for the saved P2 repositories
index 54a90627b7b88694e3d77fb485a2abf204a5eef0..6e8733952b0e69d8a895eaf4bf54a134453aae27 100644 (file)
@@ -828,10 +828,10 @@ public class PreferencesUtil implements IPreferenceKeys {
     /**
      * @return
      */
     /**
      * @return
      */
-    public static boolean isDebugMode() {
-       return getPreferenceStore().getBoolean(IS_DEBUG_MODE);
+    public static boolean isShowUpWidgetIsDisposedMessages() {
+       return getPreferenceStore().getBoolean(IS_SHOW_UP_WIDGET_IS_DISPOSED);
     }
     }
-    public static void setDebugMode(boolean selection) {
-        getPreferenceStore().setValue(IS_DEBUG_MODE, selection);
+    public static void setShowUpWidgetIsDisposedMessages(boolean selection) {
+        getPreferenceStore().setValue(IS_SHOW_UP_WIDGET_IS_DISPOSED, selection);
     }
 }
     }
 }