diff options
author | Sergey Prigogin | 2011-05-27 03:33:00 +0000 |
---|---|---|
committer | Sergey Prigogin | 2011-05-27 03:33:00 +0000 |
commit | 2641a7712639b9cb72104815fb66ee475f5b5977 (patch) | |
tree | b008e98c6cc203356555da476fd62a0541e2ab99 /codan | |
parent | f05366610d5f6042f40c633c68c4b45a3ba56b7c (diff) | |
download | org.eclipse.cdt-2641a7712639b9cb72104815fb66ee475f5b5977.tar.gz org.eclipse.cdt-2641a7712639b9cb72104815fb66ee475f5b5977.tar.xz org.eclipse.cdt-2641a7712639b9cb72104815fb66ee475f5b5977.zip |
Bug 333494 - Codan sometimes stops working after upgrade.
Diffstat (limited to 'codan')
2 files changed, 12 insertions, 35 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanUIActivator.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanUIActivator.java index 0af0fe7dba2..fcd4c9049b6 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanUIActivator.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanUIActivator.java @@ -31,7 +31,7 @@ public class CodanUIActivator extends AbstractUIPlugin { public static final String PLUGIN_ID = "org.eclipse.cdt.codan.ui"; //$NON-NLS-1$ // The shared instance private static CodanUIActivator plugin; - private IPreferenceStore preferenceCoreStore; + private IPreferenceStore corePreferenceStore; /** * The constructor @@ -39,25 +39,13 @@ public class CodanUIActivator extends AbstractUIPlugin { public CodanUIActivator() { } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext - * ) - */ + @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext - * ) - */ + @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); @@ -118,16 +106,16 @@ public class CodanUIActivator extends AbstractUIPlugin { * @return */ public IPreferenceStore getCorePreferenceStore() { - if (preferenceCoreStore == null) { - preferenceCoreStore = new ScopedPreferenceStore(new InstanceScope(), CodanCorePlugin.PLUGIN_ID); + if (corePreferenceStore == null) { + corePreferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, CodanCorePlugin.PLUGIN_ID); } - return preferenceCoreStore; + return corePreferenceStore; } public IPreferenceStore getPreferenceStore(IProject project) { ProjectScope ps = new ProjectScope(project); - ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, PLUGIN_ID); - scoped.setSearchContexts(new IScopeContext[] { ps, new InstanceScope() }); + ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, CodanCorePlugin.PLUGIN_ID); + scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE }); return scoped; } } diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java index 473222f9870..e14efffe2d7 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Alena Laskavaia and others. + * Copyright (c) 2011 Alena Laskavaia 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 @@ -7,6 +7,7 @@ * * Contributors: * Alena Laskavaia - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.codan.internal.ui.preferences; @@ -25,20 +26,10 @@ import org.eclipse.ui.IWorkbenchPropertyPage; public class BuildPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage { private IAdaptable element; - /** - * - */ public BuildPropertyPage() { - setPreferenceStore(CodanUIActivator.getDefault().getPreferenceStore()); + setPreferenceStore(CodanUIActivator.getDefault().getCorePreferenceStore()); } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors - * () - */ @Override protected void createFieldEditors() { addField(new LabelFieldEditor("Set launch method for checkers, you can override this by editing individual problem settings", @@ -87,9 +78,7 @@ public class BuildPropertyPage extends FieldEditorPreferencePage implements IWor /* * (non-Javadoc) * - * @see - * org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime - * .IAdaptable) + * @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable) */ public void setElement(IAdaptable element) { this.element = element; |