mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Fix deprecation warnings
This commit is contained in:
parent
4a37d52c1c
commit
8de0852813
12 changed files with 69 additions and 51 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2001, 2010 IBM Corporation and others.
|
||||
* Copyright (c) 2001, 2011 IBM Corporation 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
|
||||
|
@ -432,7 +432,7 @@ public class StubUtility {
|
|||
return lineDelimiter;
|
||||
}
|
||||
// workspace preference
|
||||
scopeContext= new IScopeContext[] { new InstanceScope() };
|
||||
scopeContext= new IScopeContext[] { InstanceScope.INSTANCE };
|
||||
String platformDefault= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, platformDefault, scopeContext);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2010 QNX Software Systems and others.
|
||||
* Copyright (c) 2002, 2011 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
|
||||
|
@ -477,7 +477,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
|||
*/
|
||||
public static Preferences getBuildLogPreferences(IProject project) {
|
||||
if (project == null)
|
||||
return new InstanceScope().getNode(QUALIFIER).node(GLOBAL_BUILD_CONSOLE_NODE);
|
||||
return InstanceScope.INSTANCE.getNode(QUALIFIER).node(GLOBAL_BUILD_CONSOLE_NODE);
|
||||
else
|
||||
return new LocalProjectScope(project).getNode(QUALIFIER).node(BUILD_CONSOLE_NODE);
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
|||
*/
|
||||
public static IPreferenceStore getBuildLogPreferenceStore(IProject project) {
|
||||
if (project == null)
|
||||
return new ScopedPreferenceStore(new InstanceScope(), QUALIFIER + "/" + GLOBAL_BUILD_CONSOLE_NODE); //$NON-NLS-1$
|
||||
return new ScopedPreferenceStore(InstanceScope.INSTANCE, QUALIFIER + "/" + GLOBAL_BUILD_CONSOLE_NODE); //$NON-NLS-1$
|
||||
else
|
||||
return new ScopedPreferenceStore(new LocalProjectScope(project), QUALIFIER + "/" + BUILD_CONSOLE_NODE); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2010 QNX Software Systems and others.
|
||||
* Copyright (c) 2002, 2011 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
|
||||
|
@ -244,7 +244,7 @@ public class BuildConsolePage extends Page
|
|||
|
||||
JFaceResources.getFontRegistry().addListener(this);
|
||||
setFont(JFaceResources.getFont(BuildConsolePreferencePage.PREF_BUILDCONSOLE_FONT));
|
||||
setTabs(CUIPlugin.getDefault().getPluginPreferences().getInt(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH));
|
||||
setTabs(CUIPlugin.getDefault().getPreferenceStore().getInt(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH));
|
||||
|
||||
getConsole().addPropertyChangeListener(this);
|
||||
CUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
|
||||
|
@ -294,7 +294,7 @@ public class BuildConsolePage extends Page
|
|||
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_FONT)) {
|
||||
setFont(JFaceResources.getFont(BuildConsolePreferencePage.PREF_BUILDCONSOLE_FONT));
|
||||
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH)) {
|
||||
setTabs(CUIPlugin.getDefault().getPluginPreferences().getInt(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH));
|
||||
setTabs(CUIPlugin.getDefault().getPreferenceStore().getInt(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH));
|
||||
} else if (IConsoleConstants.P_BACKGROUND_COLOR.equals(property)) {
|
||||
fViewer.getTextWidget().setBackground(fConsole.getBackground());
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2010 IBM Corporation and others.
|
||||
* Copyright (c) 2007, 2011 IBM Corporation 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,8 +14,9 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.core.runtime.content.IContentType;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.eclipse.jface.preference.PreferencePage;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
@ -105,8 +106,9 @@ public class WorkspaceLanguageMappingPreferencePage extends PreferencePage imple
|
|||
@Override
|
||||
protected void performDefaults() {
|
||||
super.performDefaults();
|
||||
Preferences node = CCorePlugin.getDefault().getPluginPreferences();
|
||||
node.setToDefault(CCorePreferenceConstants.WORKSPACE_LANGUAGE_MAPPINGS);
|
||||
// set to default
|
||||
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID);
|
||||
node.remove(CCorePreferenceConstants.WORKSPACE_LANGUAGE_MAPPINGS);
|
||||
try {
|
||||
// remove workspace mappings
|
||||
Map<String,String> currentMappings= fMappings.getWorkspaceMappings();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2011 IBM Corporation 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
|
||||
|
@ -198,13 +198,13 @@ public abstract class OptionsConfigurationBlock {
|
|||
if (fProject != null) {
|
||||
fLookupOrder= new IScopeContext[] {
|
||||
new ProjectScope(fProject),
|
||||
new InstanceScope(),
|
||||
new DefaultScope()
|
||||
InstanceScope.INSTANCE,
|
||||
DefaultScope.INSTANCE
|
||||
};
|
||||
} else {
|
||||
fLookupOrder= new IScopeContext[] {
|
||||
new InstanceScope(),
|
||||
new DefaultScope()
|
||||
InstanceScope.INSTANCE,
|
||||
DefaultScope.INSTANCE
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -256,12 +256,12 @@ public abstract class OptionsConfigurationBlock {
|
|||
}
|
||||
|
||||
private int getRebuildCount() {
|
||||
return fManager.getWorkingCopy(new DefaultScope().getNode(CUIPlugin.PLUGIN_ID)).getInt(REBUILD_COUNT_KEY, 0);
|
||||
return fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID)).getInt(REBUILD_COUNT_KEY, 0);
|
||||
}
|
||||
|
||||
private void incrementRebuildCount() {
|
||||
fRebuildCount++;
|
||||
fManager.getWorkingCopy(new DefaultScope().getNode(CUIPlugin.PLUGIN_ID)).putInt(REBUILD_COUNT_KEY, fRebuildCount);
|
||||
fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID)).putInt(REBUILD_COUNT_KEY, fRebuildCount);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2011 IBM Corporation 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
|
||||
|
@ -43,11 +43,11 @@ public class PreferencesAccess {
|
|||
}
|
||||
|
||||
public IScopeContext getDefaultScope() {
|
||||
return new DefaultScope();
|
||||
return DefaultScope.INSTANCE;
|
||||
}
|
||||
|
||||
public IScopeContext getInstanceScope() {
|
||||
return new InstanceScope();
|
||||
return InstanceScope.INSTANCE;
|
||||
}
|
||||
|
||||
public IScopeContext getProjectScope(IProject project) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2009 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2011 IBM Corporation 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
|
||||
|
@ -17,7 +17,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.rules.ICharacterScanner;
|
||||
import org.eclipse.jface.text.rules.IToken;
|
||||
|
@ -133,18 +132,18 @@ public final class TaskTagRule extends CombinedWordRule implements IPropertyChan
|
|||
* @param token the token to return for words recognized as task tags
|
||||
* @param defaultToken
|
||||
* @param preferenceStore
|
||||
* @param corePreferences
|
||||
* @param corePreferenceStore
|
||||
*/
|
||||
public TaskTagRule(IToken token, IToken defaultToken, IPreferenceStore preferenceStore,
|
||||
Preferences corePreferences) {
|
||||
IPreferenceStore corePreferenceStore) {
|
||||
super(new TaskTagDetector(), defaultToken);
|
||||
fMatcher = new TaskTagMatcher(token);
|
||||
addWordMatcher(fMatcher);
|
||||
String taskWords= null;
|
||||
if (preferenceStore.contains(TODO_TASK_TAGS)) {
|
||||
taskWords= preferenceStore.getString(TODO_TASK_TAGS);
|
||||
} else if (corePreferences != null) {
|
||||
taskWords= corePreferences.getString(TODO_TASK_TAGS);
|
||||
} else if (corePreferenceStore != null) {
|
||||
taskWords= corePreferenceStore.getString(TODO_TASK_TAGS);
|
||||
}
|
||||
if (taskWords != null) {
|
||||
addTaskTags(taskWords);
|
||||
|
@ -153,8 +152,8 @@ public final class TaskTagRule extends CombinedWordRule implements IPropertyChan
|
|||
boolean isCaseSensitive= true;
|
||||
if (preferenceStore.contains(TODO_TASK_CASE_SENSITIVE)) {
|
||||
isCaseSensitive= preferenceStore.getBoolean(TODO_TASK_CASE_SENSITIVE);
|
||||
} else if (corePreferences != null) {
|
||||
isCaseSensitive= corePreferences.getBoolean(TODO_TASK_CASE_SENSITIVE);
|
||||
} else if (corePreferenceStore != null) {
|
||||
isCaseSensitive= corePreferenceStore.getBoolean(TODO_TASK_CASE_SENSITIVE);
|
||||
}
|
||||
fMatcher.setCaseSensitive(isCaseSensitive);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2011 IBM Corporation 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,12 +15,12 @@ package org.eclipse.cdt.internal.ui.text.spelling;
|
|||
import java.net.URL;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
|
||||
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.CCorePreferenceConstants;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.text.spelling.engine.AbstractSpellDictionary;
|
||||
|
||||
|
@ -42,18 +42,18 @@ public class TaskTagDictionary extends AbstractSpellDictionary implements IPrope
|
|||
*/
|
||||
@Override
|
||||
protected synchronized boolean load(final URL url) {
|
||||
final Plugin plugin= CCorePlugin.getDefault();
|
||||
final CUIPlugin plugin= CUIPlugin.getDefault();
|
||||
if (plugin != null) {
|
||||
plugin.getPluginPreferences().addPropertyChangeListener(this);
|
||||
plugin.getCorePreferenceStore().addPropertyChangeListener(this);
|
||||
return updateTaskTags();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
|
||||
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
*/
|
||||
public void propertyChange(final PropertyChangeEvent event) {
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (CCorePreferenceConstants.TODO_TASK_TAGS.equals(event.getProperty()))
|
||||
updateTaskTags();
|
||||
}
|
||||
|
@ -63,9 +63,9 @@ public class TaskTagDictionary extends AbstractSpellDictionary implements IPrope
|
|||
*/
|
||||
@Override
|
||||
public synchronized void unload() {
|
||||
final Plugin plugin= CCorePlugin.getDefault();
|
||||
final CUIPlugin plugin= CUIPlugin.getDefault();
|
||||
if (plugin != null)
|
||||
plugin.getPluginPreferences().removePropertyChangeListener(this);
|
||||
plugin.getCorePreferenceStore().removePropertyChangeListener(this);
|
||||
|
||||
super.unload();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2008 QNX Software Systems and others.
|
||||
* Copyright (c) 2004, 2011 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
|
||||
|
@ -44,7 +44,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.swt.widgets.Tree;
|
||||
import org.eclipse.ui.dialogs.SelectionStatusDialog;
|
||||
|
||||
import org.eclipse.cdt.core.browser.PathUtil;
|
||||
import org.eclipse.cdt.utils.PathUtil;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICContainer;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2010 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2011 IBM Corporation 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
|
||||
|
@ -276,7 +276,6 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
return MessageFormat.format(getResourceString(key), new Object[] {arg});
|
||||
}
|
||||
|
||||
@SuppressWarnings("cast") // java.text.MessageFormat would require the cast
|
||||
public static String getFormattedString(String key, String[] args) {
|
||||
return MessageFormat.format(getResourceString(key), (Object[]) args);
|
||||
}
|
||||
|
@ -381,6 +380,12 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
*/
|
||||
private IPreferenceStore fCombinedPreferenceStore;
|
||||
|
||||
/**
|
||||
* The core preference store.
|
||||
* @since 5.3
|
||||
*/
|
||||
private IPreferenceStore fCorePreferenceStore;
|
||||
|
||||
private CoreModel fCoreModel;
|
||||
private CDocumentProvider fDocumentProvider;
|
||||
private WorkingCopyManager fWorkingCopyManager;
|
||||
|
@ -655,13 +660,25 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
if (fCombinedPreferenceStore == null) {
|
||||
fCombinedPreferenceStore= new ChainedPreferenceStore(new IPreferenceStore[] {
|
||||
getPreferenceStore(),
|
||||
new ScopedPreferenceStore(new InstanceScope(), PLUGIN_CORE_ID),
|
||||
getCorePreferenceStore(),
|
||||
EditorsUI.getPreferenceStore()
|
||||
});
|
||||
}
|
||||
return fCombinedPreferenceStore;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a preference store for org.eclipse.cdt.core preferences
|
||||
* @return the preference store
|
||||
* @since 5.3
|
||||
*/
|
||||
public IPreferenceStore getCorePreferenceStore() {
|
||||
if (fCorePreferenceStore == null) {
|
||||
fCorePreferenceStore= new ScopedPreferenceStore(InstanceScope.INSTANCE, PLUGIN_CORE_ID);
|
||||
}
|
||||
return fCorePreferenceStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a section in the C UI plugin's dialog settings. If the section doesn't exist yet, it is created.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2007, 2011 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
|
||||
|
@ -127,7 +127,7 @@ public class CacheSizeBlock extends AbstractCOptionPage {
|
|||
}
|
||||
|
||||
private void initializeValues() {
|
||||
ScopedPreferenceStore prefStore= new ScopedPreferenceStore(new InstanceScope(), CCorePlugin.PLUGIN_ID);
|
||||
ScopedPreferenceStore prefStore= new ScopedPreferenceStore(InstanceScope.INSTANCE, CCorePlugin.PLUGIN_ID);
|
||||
|
||||
fDBLimitPct.setPreferenceStore(prefStore);
|
||||
fDBLimitPct.setPropertyChangeListener(validityChangeListener);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008, 2009 Symbian Software Systems and others.
|
||||
* Copyright (c) 2008, 2011 Symbian 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
|
||||
|
@ -14,7 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
|
||||
import org.eclipse.jface.text.rules.IRule;
|
||||
import org.eclipse.jface.text.rules.IToken;
|
||||
|
@ -37,7 +37,7 @@ import org.eclipse.cdt.internal.ui.text.TaskTagRule;
|
|||
*/
|
||||
public class GenericTagCommentScanner extends BufferedRuleBasedScanner implements ICTokenScanner {
|
||||
protected TaskTagRule fTaskTagRule;
|
||||
protected Preferences fCorePreferenceStore;
|
||||
protected IPreferenceStore fCorePreferenceStore;
|
||||
protected String fDefaultTokenProperty;
|
||||
protected String fTagToken;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue