diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java index f9c87fcc19a..b6a4e6d6fe0 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java @@ -16,6 +16,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.MissingResourceException; import java.util.ResourceBundle; +import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.internal.ui.editor.IMakefileDocumentProvider; import org.eclipse.cdt.make.internal.ui.editor.MakefileDocumentProvider; import org.eclipse.cdt.make.internal.ui.editor.WorkingCopyManager; @@ -26,6 +27,7 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; @@ -36,6 +38,7 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.ui.preferences.ScopedPreferenceStore; import org.eclipse.ui.texteditor.ChainedPreferenceStore; import org.osgi.framework.BundleContext; @@ -50,6 +53,7 @@ public class MakeUIPlugin extends AbstractUIPlugin { private IWorkingCopyManager fWorkingCopyManager; private IMakefileDocumentProvider fMakefileDocumentProvider; + private ScopedPreferenceStore fCorePreferenceStore; /** * The constructor. @@ -269,6 +273,16 @@ public class MakeUIPlugin extends AbstractUIPlugin { return chainedStore; } + /** + * Returns a preference store for org.eclipse.cdt.make.core preferences + * @return the preference store + */ + public IPreferenceStore getCorePreferenceStore() { + if (fCorePreferenceStore == null) { + fCorePreferenceStore= new ScopedPreferenceStore(InstanceScope.INSTANCE, MakeCorePlugin.PLUGIN_ID); + } + return fCorePreferenceStore; + } @Override public void start(BundleContext context) throws Exception { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileSettingsPreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileSettingsPreferencePage.java index a4a5372cb8c..d0581a4483a 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileSettingsPreferencePage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileSettingsPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2010 QNX Software Systems and others. + * Copyright (c) 2002, 2012 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,8 +13,8 @@ package org.eclipse.cdt.make.internal.ui.preferences; import org.eclipse.cdt.make.core.MakeCorePlugin; +import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; import org.eclipse.cdt.make.ui.IMakeHelpContextIds; -import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PathEditor; @@ -23,7 +23,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.preferences.ScopedPreferenceStore; /** * MakePreferencePage @@ -37,7 +36,7 @@ public class MakefileSettingsPreferencePage extends FieldEditorPreferencePage im public MakefileSettingsPreferencePage() { super(GRID); - IPreferenceStore store = new ScopedPreferenceStore(new InstanceScope(), MakeCorePlugin.PLUGIN_ID); + IPreferenceStore store = MakeUIPlugin.getDefault().getCorePreferenceStore(); setPreferenceStore(store); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index d4dd71a7069..2d4c743da09 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -41,7 +41,6 @@ import org.eclipse.core.runtime.content.IContentType; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; -import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.help.IContext; import org.eclipse.help.IContextProvider; import org.eclipse.jface.action.GroupMarker; @@ -149,7 +148,6 @@ import org.eclipse.ui.part.EditorActionBarContributor; import org.eclipse.ui.part.IShowInSource; import org.eclipse.ui.part.IShowInTargetList; import org.eclipse.ui.part.ShowInContext; -import org.eclipse.ui.preferences.ScopedPreferenceStore; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; import org.eclipse.ui.texteditor.AnnotationPreference; @@ -3649,7 +3647,7 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi } stores.add(CUIPlugin.getDefault().getPreferenceStore()); - stores.add(new ScopedPreferenceStore(InstanceScope.INSTANCE, CCorePlugin.PLUGIN_ID)); + stores.add(CUIPlugin.getDefault().getCorePreferenceStore()); stores.add(EditorsUI.getPreferenceStore()); return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()])); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java index 7855d8aa996..f9a0e4031ec 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/AbstractMixedPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Jens Elmenthaler and others + * Copyright (c) 2011, 2012 Jens Elmenthaler and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,16 +15,13 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.ui.CUIPlugin; /** * A preference that on preference from the UI plugin, as well the CDT core. @@ -49,8 +46,8 @@ public abstract class AbstractMixedPreferencePage extends AbstractPreferencePage }; public AbstractMixedPreferencePage() { - corePrefsOverlayStore = new OverlayPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, - CCorePlugin.PLUGIN_ID), createCorePrefsOverlayStoreKeys()); + corePrefsOverlayStore = new OverlayPreferenceStore(CUIPlugin.getDefault().getCorePreferenceStore(), + createCorePrefsOverlayStoreKeys()); } protected Button addCorePrefsCheckBox(Composite parent, String label, String key, int indentation) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CacheSizeBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CacheSizeBlock.java index 4547cbf212b..3edf9241595 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CacheSizeBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CacheSizeBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others. + * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,9 +14,9 @@ package org.eclipse.cdt.ui.dialogs; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.layout.PixelConverter; import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IntegerFieldEditor; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; @@ -26,13 +26,12 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.preferences.ScopedPreferenceStore; -import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePreferenceConstants; import org.eclipse.cdt.core.dom.CDOM; import org.eclipse.cdt.core.parser.CodeReaderCache; import org.eclipse.cdt.core.parser.ICodeReaderCache; +import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil; @@ -140,7 +139,7 @@ public class CacheSizeBlock extends AbstractCOptionPage { } private void initializeValues() { - ScopedPreferenceStore prefStore= new ScopedPreferenceStore(InstanceScope.INSTANCE, CCorePlugin.PLUGIN_ID); + IPreferenceStore prefStore= CUIPlugin.getDefault().getCorePreferenceStore(); fDBLimitPct.setPreferenceStore(prefStore); fDBLimitPct.setPropertyChangeListener(validityChangeListener);