Skip to content

Commit 5226387

Browse files
authored
"Validation builder on java projects ..." pref is on by default #24 (#31)
1 parent e61c809 commit 5226387

4 files changed

Lines changed: 17 additions & 27 deletions

File tree

org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/MsgEditorPreferences.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@
2828
import org.eclipse.core.runtime.CoreException;
2929
import org.eclipse.core.runtime.IStatus;
3030
import org.eclipse.core.runtime.NullProgressMonitor;
31-
import org.eclipse.core.runtime.Preferences;
32-
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
3331
import org.eclipse.core.runtime.Status;
32+
import org.eclipse.core.text.StringMatcher;
3433
import org.eclipse.jface.dialogs.MessageDialog;
34+
import org.eclipse.jface.preference.IPreferenceStore;
35+
import org.eclipse.jface.util.IPropertyChangeListener;
36+
import org.eclipse.jface.util.PropertyChangeEvent;
3537
import org.eclipse.ui.IEditorPart;
3638
import org.eclipse.ui.IEditorReference;
3739
import org.eclipse.ui.IWorkbenchPage;
3840
import org.eclipse.ui.PlatformUI;
39-
import org.eclipse.core.text.StringMatcher;
4041

4142
/**
4243
* Messages Editor preferences.
@@ -187,8 +188,7 @@ public final class MsgEditorPreferences implements IPropertyChangeListener {
187188
public static final String ENABLE_PROPERTIES_INDEXER = "enablePropertiesIndexer";
188189

189190
/** MsgEditorPreferences. */
190-
private static final Preferences PREFS = MessagesEditorPlugin.getDefault()
191-
.getPluginPreferences();
191+
private static final IPreferenceStore PREFS = MessagesEditorPlugin.getDefault().getPreferenceStore();
192192

193193
private static final MsgEditorPreferences INSTANCE = new MsgEditorPreferences();
194194

@@ -494,7 +494,7 @@ public boolean isBuilderSetupAutomatically() {
494494
* the property change event object describing which property
495495
* changed and how
496496
*/
497-
public void propertyChange(Preferences.PropertyChangeEvent event) {
497+
public void propertyChange(PropertyChangeEvent event) {
498498
if (FILTER_LOCALES_STRING_MATCHERS.equals(event.getProperty())) {
499499
onLocalFilterChange();
500500
} else if (ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS.equals(event

org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PreferenceInitializer.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
******************************************************************************/
1111
package org.eclipse.babel.editor.preferences;
1212

13+
import org.eclipse.babel.core.message.resource.ser.IPropertiesSerializerConfig;
1314
import org.eclipse.babel.editor.IMessagesEditorChangeListener;
1415
import org.eclipse.babel.editor.plugin.MessagesEditorPlugin;
15-
import org.eclipse.core.runtime.Preferences;
1616
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
17+
import org.eclipse.jface.preference.IPreferenceStore;
1718

1819
/**
1920
* Initializes default preferences.
@@ -22,20 +23,13 @@
2223
*/
2324
public class PreferenceInitializer extends AbstractPreferenceInitializer {
2425

25-
/**
26-
* Constructor.
27-
*/
28-
public PreferenceInitializer() {
29-
super();
30-
}
31-
3226
/**
3327
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer
3428
* #initializeDefaultPreferences()
3529
*/
3630
public void initializeDefaultPreferences() {
37-
Preferences prefs = MessagesEditorPlugin.getDefault()
38-
.getPluginPreferences();
31+
32+
IPreferenceStore prefs = MessagesEditorPlugin.getDefault().getPreferenceStore();
3933

4034
// General
4135
prefs.setDefault(MsgEditorPreferences.UNICODE_UNESCAPE_ENABLED, true);
@@ -71,7 +65,7 @@ public void initializeDefaultPreferences() {
7165

7266
prefs.setDefault(
7367
MsgEditorPreferences.NEW_LINE_STYLE,
74-
MsgEditorPreferences.getInstance().getSerializerConfig().NEW_LINE_UNIX);
68+
IPropertiesSerializerConfig.NEW_LINE_UNIX);
7569

7670
prefs.setDefault(MsgEditorPreferences.KEEP_EMPTY_FIELDS, false);
7771
prefs.setDefault(MsgEditorPreferences.SORT_KEYS, true);
@@ -94,14 +88,12 @@ public void initializeDefaultPreferences() {
9488
// locales filter: by default: don't filter locales.
9589
prefs.setDefault(MsgEditorPreferences.FILTER_LOCALES_STRING_MATCHERS,
9690
"*"); //$NON-NLS-1$
97-
prefs.addPropertyChangeListener(MsgEditorPreferences.getInstance());
9891

9992
// setup the i18n validation nature and its associated builder
10093
// on all java projects when the plugin is started
10194
// an when the editor is opened.
102-
prefs.setDefault(
103-
MsgEditorPreferences.ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS,
104-
true); //$NON-NLS-1$
95+
prefs.setDefault(MsgEditorPreferences.ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS, false); // Changed 20231021
96+
10597
prefs.addPropertyChangeListener(MsgEditorPreferences.getInstance());
10698

10799
}

org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesDeserializerConfig.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.eclipse.babel.core.configuration.ConfigurationManager;
1515
import org.eclipse.babel.core.message.resource.ser.IPropertiesDeserializerConfig;
1616
import org.eclipse.babel.editor.plugin.MessagesEditorPlugin;
17-
import org.eclipse.core.runtime.Preferences;
17+
import org.eclipse.jface.preference.IPreferenceStore;
1818

1919
/**
2020
* The concrete implementation of {@link IPropertiesDeserializerConfig}.
@@ -26,8 +26,7 @@ public class PropertiesDeserializerConfig implements
2626
// make it more flexible.
2727

2828
/** MsgEditorPreferences. */
29-
private static final Preferences PREFS = MessagesEditorPlugin.getDefault()
30-
.getPluginPreferences();
29+
private static final IPreferenceStore PREFS = MessagesEditorPlugin.getDefault().getPreferenceStore();
3130

3231
PropertiesDeserializerConfig() {
3332
ConfigurationManager.getInstance().setDeserializerConfig(this);

org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesSerializerConfig.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.eclipse.babel.core.configuration.ConfigurationManager;
1515
import org.eclipse.babel.core.message.resource.ser.IPropertiesSerializerConfig;
1616
import org.eclipse.babel.editor.plugin.MessagesEditorPlugin;
17-
import org.eclipse.core.runtime.Preferences;
17+
import org.eclipse.jface.preference.IPreferenceStore;
1818

1919
/**
2020
* The concrete implementation of {@link IPropertiesSerializerConfig}.
@@ -25,8 +25,7 @@ public class PropertiesSerializerConfig implements IPropertiesSerializerConfig {
2525
// Moved from MsgEditorPreferences, to make it more flexible.
2626

2727
/** MsgEditorPreferences. */
28-
private static final Preferences PREFS = MessagesEditorPlugin.getDefault()
29-
.getPluginPreferences();
28+
private static final IPreferenceStore PREFS = MessagesEditorPlugin.getDefault().getPreferenceStore();
3029

3130
PropertiesSerializerConfig() {
3231
ConfigurationManager.getInstance().setSerializerConfig(this);

0 commit comments

Comments
 (0)