Skip to content

Commit ea2f35b

Browse files
deepika-uHeikoKlare
authored andcommitted
Use IEclipsePreferences instead of Preferences.
1 parent ae3df73 commit ea2f35b

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2018 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -27,7 +27,8 @@
2727
import org.eclipse.core.resources.IncrementalProjectBuilder;
2828
import org.eclipse.core.resources.ResourcesPlugin;
2929
import org.eclipse.core.runtime.Platform;
30-
import org.eclipse.core.runtime.Preferences;
30+
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
31+
import org.eclipse.core.runtime.preferences.InstanceScope;
3132
import org.eclipse.jface.action.ActionContributionItem;
3233
import org.eclipse.jface.action.GroupMarker;
3334
import org.eclipse.jface.action.IAction;
@@ -214,7 +215,7 @@ public class WorkbenchActionBuilder extends ActionBarAdvisor {
214215
// @issue class is workbench internal
215216
private StatusLineContributionItem statusLineItem;
216217

217-
private Preferences.IPropertyChangeListener prefListener;
218+
private IEclipsePreferences.IPreferenceChangeListener prefListener;
218219

219220
// listener for the "close editors automatically"
220221
// preference change
@@ -305,13 +306,12 @@ public void partBroughtToTop(IWorkbenchPart part) {
305306
getWindow().getPartService().addPartListener(partListener);
306307

307308
prefListener = event -> {
308-
if (event.getProperty().equals(
309-
ResourcesPlugin.PREF_AUTO_BUILDING)) {
309+
if (event.getKey().equals(ResourcesPlugin.PREF_AUTO_BUILDING)) {
310310
updateBuildActions(false);
311311
}
312312
};
313-
ResourcesPlugin.getPlugin().getPluginPreferences()
314-
.addPropertyChangeListener(prefListener);
313+
InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES)
314+
.addPreferenceChangeListener(prefListener);
315315

316316
// listener for the "close editors automatically"
317317
// preference change
@@ -835,8 +835,7 @@ public void dispose() {
835835
partListener = null;
836836
}
837837
if (prefListener != null) {
838-
ResourcesPlugin.getPlugin().getPluginPreferences()
839-
.removePropertyChangeListener(prefListener);
838+
InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES).removePreferenceChangeListener(prefListener);
840839
prefListener = null;
841840
}
842841
if (propPrefListener != null) {

0 commit comments

Comments
 (0)