Revision d3d01e43
Added by Katja Luther almost 8 years ago
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java | ||
---|---|---|
136 | 136 |
|
137 | 137 |
} else if (t != null && ("Widget is disposed".equals(t.getMessage()))){ |
138 | 138 |
MessagingUtils.warn(this.getClass(), t); |
139 |
if (PreferencesUtil.isDebugMode()){
|
|
139 |
if (PreferencesUtil.isShowUpWidgetIsDisposedMessages()){
|
|
140 | 140 |
MessagingUtils.errorDialog("Widget is disposed", |
141 | 141 |
null, |
142 | 142 |
MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE, |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2016 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.preference; |
|
11 |
|
|
12 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
13 |
import org.eclipse.jface.preference.FieldEditorPreferencePage; |
|
14 |
import org.eclipse.ui.IWorkbench; |
|
15 |
import org.eclipse.ui.IWorkbenchPreferencePage; |
|
16 |
|
|
17 |
/** |
|
18 |
* @author k.luther |
|
19 |
* @date 01.04.2016 |
|
20 |
* |
|
21 |
*/ |
|
22 |
public class DebugPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { |
|
23 |
|
|
24 |
/* (non-Javadoc) |
|
25 |
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) |
|
26 |
*/ |
|
27 |
@Override |
|
28 |
public void init(IWorkbench workbench) { |
|
29 |
setPreferenceStore(PreferencesUtil.getPreferenceStore()); |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
/* (non-Javadoc) |
|
34 |
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() |
|
35 |
*/ |
|
36 |
@Override |
|
37 |
protected void createFieldEditors() { |
|
38 |
addField(new BooleanFieldEditor(IPreferenceKeys.IS_SHOW_UP_WIDGET_IS_DISPOSED, |
|
39 |
"Show up widget is disposed error messages.", |
|
40 |
getFieldEditorParent())); |
|
41 |
|
|
42 |
} |
|
43 |
|
|
44 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java | ||
---|---|---|
155 | 155 |
|
156 | 156 |
public static final String DEFAULT_LANGUAGE_EDITOR = "eu.etaxonomy.taxeditor.default.language"; |
157 | 157 |
|
158 |
public static final String IS_DEBUG_MODE = "eu.etaxonomy.taxeditor.idDebugMode";
|
|
158 |
public static final String IS_SHOW_UP_WIDGET_IS_DISPOSED = "eu.etaxonomy.taxeditor.isShowUpWidgetIsDisposed";
|
|
159 | 159 |
|
160 | 160 |
/** |
161 | 161 |
* Key for the saved P2 repositories |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
828 | 828 |
/** |
829 | 829 |
* @return |
830 | 830 |
*/ |
831 |
public static boolean isDebugMode() {
|
|
832 |
return getPreferenceStore().getBoolean(IS_DEBUG_MODE);
|
|
831 |
public static boolean isShowUpWidgetIsDisposedMessages() {
|
|
832 |
return getPreferenceStore().getBoolean(IS_SHOW_UP_WIDGET_IS_DISPOSED);
|
|
833 | 833 |
} |
834 |
public static void setDebugMode(boolean selection) {
|
|
835 |
getPreferenceStore().setValue(IS_DEBUG_MODE, selection);
|
|
834 |
public static void setShowUpWidgetIsDisposedMessages(boolean selection) {
|
|
835 |
getPreferenceStore().setValue(IS_SHOW_UP_WIDGET_IS_DISPOSED, selection);
|
|
836 | 836 |
} |
837 | 837 |
} |
Also available in: Unified diff
minor changes for #4657