Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 333494
Collapse All | Expand All

(-)src/org/eclipse/cdt/codan/internal/ui/CodanUIActivator.java (-20 / +8 lines)
Lines 31-37 Link Here
31
	public static final String PLUGIN_ID = "org.eclipse.cdt.codan.ui"; //$NON-NLS-1$
31
	public static final String PLUGIN_ID = "org.eclipse.cdt.codan.ui"; //$NON-NLS-1$
32
	// The shared instance
32
	// The shared instance
33
	private static CodanUIActivator plugin;
33
	private static CodanUIActivator plugin;
34
	private IPreferenceStore preferenceCoreStore;
34
	private IPreferenceStore corePreferenceStore;
35
35
36
	/**
36
	/**
37
	 * The constructor
37
	 * The constructor
Lines 39-63 Link Here
39
	public CodanUIActivator() {
39
	public CodanUIActivator() {
40
	}
40
	}
41
41
42
	/*
42
	@Override
43
	 * (non-Javadoc)
44
	 * 
45
	 * @see
46
	 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
47
	 * )
48
	 */
49
	public void start(BundleContext context) throws Exception {
43
	public void start(BundleContext context) throws Exception {
50
		super.start(context);
44
		super.start(context);
51
		plugin = this;
45
		plugin = this;
52
	}
46
	}
53
47
54
	/*
48
	@Override
55
	 * (non-Javadoc)
56
	 * 
57
	 * @see
58
	 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
59
	 * )
60
	 */
61
	public void stop(BundleContext context) throws Exception {
49
	public void stop(BundleContext context) throws Exception {
62
		plugin = null;
50
		plugin = null;
63
		super.stop(context);
51
		super.stop(context);
Lines 118-133 Link Here
118
	 * @return
106
	 * @return
119
	 */
107
	 */
120
	public IPreferenceStore getCorePreferenceStore() {
108
	public IPreferenceStore getCorePreferenceStore() {
121
		if (preferenceCoreStore == null) {
109
		if (corePreferenceStore == null) {
122
			preferenceCoreStore = new ScopedPreferenceStore(new InstanceScope(), CodanCorePlugin.PLUGIN_ID);
110
			corePreferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, CodanCorePlugin.PLUGIN_ID);
123
		}
111
		}
124
		return preferenceCoreStore;
112
		return corePreferenceStore;
125
	}
113
	}
126
114
127
	public IPreferenceStore getPreferenceStore(IProject project) {
115
	public IPreferenceStore getPreferenceStore(IProject project) {
128
		ProjectScope ps = new ProjectScope(project);
116
		ProjectScope ps = new ProjectScope(project);
129
		ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, PLUGIN_ID);
117
		ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, CodanCorePlugin.PLUGIN_ID);
130
		scoped.setSearchContexts(new IScopeContext[] { ps, new InstanceScope() });
118
		scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
131
		return scoped;
119
		return scoped;
132
	}
120
	}
133
}
121
}
(-)src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java (-15 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2010 Alena Laskavaia and others.
2
 * Copyright (c) 2011 Alena Laskavaia and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Alena Laskavaia - initial API and implementation
9
 *     Alena Laskavaia - initial API and implementation
10
 *     Sergey Prigogin (Google)
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.codan.internal.ui.preferences;
12
package org.eclipse.cdt.codan.internal.ui.preferences;
12
13
Lines 25-44 Link Here
25
public class BuildPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
26
public class BuildPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
26
	private IAdaptable element;
27
	private IAdaptable element;
27
28
28
	/**
29
	 * 
30
	 */
31
	public BuildPropertyPage() {
29
	public BuildPropertyPage() {
32
		setPreferenceStore(CodanUIActivator.getDefault().getPreferenceStore());
30
		setPreferenceStore(CodanUIActivator.getDefault().getCorePreferenceStore());
33
	}
31
	}
34
32
35
	/*
36
	 * (non-Javadoc)
37
	 * 
38
	 * @see
39
	 * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
40
	 * ()
41
	 */
42
	@Override
33
	@Override
43
	protected void createFieldEditors() {
34
	protected void createFieldEditors() {
44
		addField(new LabelFieldEditor("Set launch method for checkers, you can override this by editing individual problem settings",
35
		addField(new LabelFieldEditor("Set launch method for checkers, you can override this by editing individual problem settings",
Lines 87-95 Link Here
87
	/*
78
	/*
88
	 * (non-Javadoc)
79
	 * (non-Javadoc)
89
	 * 
80
	 * 
90
	 * @see
81
	 * @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable)
91
	 * org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime
92
	 * .IAdaptable)
93
	 */
82
	 */
94
	public void setElement(IAdaptable element) {
83
	public void setElement(IAdaptable element) {
95
		this.element = element;
84
		this.element = element;

Return to bug 333494