Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -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);
Expand Down