diff --git a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/MsgEditorPreferences.java b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/MsgEditorPreferences.java index 4cfe773..d7999f0 100644 --- a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/MsgEditorPreferences.java +++ b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/MsgEditorPreferences.java @@ -28,15 +28,16 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; import org.eclipse.core.runtime.Status; +import org.eclipse.core.text.StringMatcher; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; -import org.eclipse.core.text.StringMatcher; /** * Messages Editor preferences. @@ -187,8 +188,7 @@ public final class MsgEditorPreferences implements IPropertyChangeListener { public static final String ENABLE_PROPERTIES_INDEXER = "enablePropertiesIndexer"; /** MsgEditorPreferences. */ - private static final Preferences PREFS = MessagesEditorPlugin.getDefault() - .getPluginPreferences(); + private static final IPreferenceStore PREFS = MessagesEditorPlugin.getDefault().getPreferenceStore(); private static final MsgEditorPreferences INSTANCE = new MsgEditorPreferences(); @@ -494,7 +494,7 @@ public boolean isBuilderSetupAutomatically() { * the property change event object describing which property * changed and how */ - public void propertyChange(Preferences.PropertyChangeEvent event) { + public void propertyChange(PropertyChangeEvent event) { if (FILTER_LOCALES_STRING_MATCHERS.equals(event.getProperty())) { onLocalFilterChange(); } else if (ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS.equals(event diff --git a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PreferenceInitializer.java b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PreferenceInitializer.java index 1c1c8ec..c679d77 100644 --- a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PreferenceInitializer.java +++ b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PreferenceInitializer.java @@ -10,10 +10,11 @@ ******************************************************************************/ package org.eclipse.babel.editor.preferences; +import org.eclipse.babel.core.message.resource.ser.IPropertiesSerializerConfig; import org.eclipse.babel.editor.IMessagesEditorChangeListener; import org.eclipse.babel.editor.plugin.MessagesEditorPlugin; -import org.eclipse.core.runtime.Preferences; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; /** * Initializes default preferences. @@ -22,20 +23,13 @@ */ public class PreferenceInitializer extends AbstractPreferenceInitializer { - /** - * Constructor. - */ - public PreferenceInitializer() { - super(); - } - /** * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer * #initializeDefaultPreferences() */ public void initializeDefaultPreferences() { - Preferences prefs = MessagesEditorPlugin.getDefault() - .getPluginPreferences(); + + IPreferenceStore prefs = MessagesEditorPlugin.getDefault().getPreferenceStore(); // General prefs.setDefault(MsgEditorPreferences.UNICODE_UNESCAPE_ENABLED, true); @@ -71,7 +65,7 @@ public void initializeDefaultPreferences() { prefs.setDefault( MsgEditorPreferences.NEW_LINE_STYLE, - MsgEditorPreferences.getInstance().getSerializerConfig().NEW_LINE_UNIX); + IPropertiesSerializerConfig.NEW_LINE_UNIX); prefs.setDefault(MsgEditorPreferences.KEEP_EMPTY_FIELDS, false); prefs.setDefault(MsgEditorPreferences.SORT_KEYS, true); @@ -94,14 +88,12 @@ public void initializeDefaultPreferences() { // locales filter: by default: don't filter locales. prefs.setDefault(MsgEditorPreferences.FILTER_LOCALES_STRING_MATCHERS, "*"); //$NON-NLS-1$ - prefs.addPropertyChangeListener(MsgEditorPreferences.getInstance()); // setup the i18n validation nature and its associated builder // on all java projects when the plugin is started // an when the editor is opened. - prefs.setDefault( - MsgEditorPreferences.ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS, - true); //$NON-NLS-1$ + prefs.setDefault(MsgEditorPreferences.ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS, false); // Changed 20231021 + prefs.addPropertyChangeListener(MsgEditorPreferences.getInstance()); } diff --git a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesDeserializerConfig.java b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesDeserializerConfig.java index bbff98f..a94a655 100644 --- a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesDeserializerConfig.java +++ b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesDeserializerConfig.java @@ -14,7 +14,7 @@ import org.eclipse.babel.core.configuration.ConfigurationManager; import org.eclipse.babel.core.message.resource.ser.IPropertiesDeserializerConfig; import org.eclipse.babel.editor.plugin.MessagesEditorPlugin; -import org.eclipse.core.runtime.Preferences; +import org.eclipse.jface.preference.IPreferenceStore; /** * The concrete implementation of {@link IPropertiesDeserializerConfig}. @@ -26,8 +26,7 @@ public class PropertiesDeserializerConfig implements // make it more flexible. /** MsgEditorPreferences. */ - private static final Preferences PREFS = MessagesEditorPlugin.getDefault() - .getPluginPreferences(); + private static final IPreferenceStore PREFS = MessagesEditorPlugin.getDefault().getPreferenceStore(); PropertiesDeserializerConfig() { ConfigurationManager.getInstance().setDeserializerConfig(this); diff --git a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesSerializerConfig.java b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesSerializerConfig.java index 8b161de..d063eee 100644 --- a/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesSerializerConfig.java +++ b/org.eclipse.babel.editor/src/org/eclipse/babel/editor/preferences/PropertiesSerializerConfig.java @@ -14,7 +14,7 @@ import org.eclipse.babel.core.configuration.ConfigurationManager; import org.eclipse.babel.core.message.resource.ser.IPropertiesSerializerConfig; import org.eclipse.babel.editor.plugin.MessagesEditorPlugin; -import org.eclipse.core.runtime.Preferences; +import org.eclipse.jface.preference.IPreferenceStore; /** * The concrete implementation of {@link IPropertiesSerializerConfig}. @@ -25,8 +25,7 @@ public class PropertiesSerializerConfig implements IPropertiesSerializerConfig { // Moved from MsgEditorPreferences, to make it more flexible. /** MsgEditorPreferences. */ - private static final Preferences PREFS = MessagesEditorPlugin.getDefault() - .getPluginPreferences(); + private static final IPreferenceStore PREFS = MessagesEditorPlugin.getDefault().getPreferenceStore(); PropertiesSerializerConfig() { ConfigurationManager.getInstance().setSerializerConfig(this);