|
1 | 1 | /******************************************************************************* |
2 | | - * Copyright (c) 2000, 2018 IBM Corporation and others. |
| 2 | + * Copyright (c) 2000, 2026 IBM Corporation and others. |
3 | 3 | * |
4 | 4 | * This program and the accompanying materials |
5 | 5 | * are made available under the terms of the Eclipse Public License 2.0 |
|
27 | 27 | import org.eclipse.core.resources.IncrementalProjectBuilder; |
28 | 28 | import org.eclipse.core.resources.ResourcesPlugin; |
29 | 29 | 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; |
31 | 32 | import org.eclipse.jface.action.ActionContributionItem; |
32 | 33 | import org.eclipse.jface.action.GroupMarker; |
33 | 34 | import org.eclipse.jface.action.IAction; |
@@ -214,7 +215,7 @@ public class WorkbenchActionBuilder extends ActionBarAdvisor { |
214 | 215 | // @issue class is workbench internal |
215 | 216 | private StatusLineContributionItem statusLineItem; |
216 | 217 |
|
217 | | - private Preferences.IPropertyChangeListener prefListener; |
| 218 | + private IEclipsePreferences.IPreferenceChangeListener prefListener; |
218 | 219 |
|
219 | 220 | // listener for the "close editors automatically" |
220 | 221 | // preference change |
@@ -305,13 +306,12 @@ public void partBroughtToTop(IWorkbenchPart part) { |
305 | 306 | getWindow().getPartService().addPartListener(partListener); |
306 | 307 |
|
307 | 308 | prefListener = event -> { |
308 | | - if (event.getProperty().equals( |
309 | | - ResourcesPlugin.PREF_AUTO_BUILDING)) { |
| 309 | + if (event.getKey().equals(ResourcesPlugin.PREF_AUTO_BUILDING)) { |
310 | 310 | updateBuildActions(false); |
311 | 311 | } |
312 | 312 | }; |
313 | | - ResourcesPlugin.getPlugin().getPluginPreferences() |
314 | | - .addPropertyChangeListener(prefListener); |
| 313 | + InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES) |
| 314 | + .addPreferenceChangeListener(prefListener); |
315 | 315 |
|
316 | 316 | // listener for the "close editors automatically" |
317 | 317 | // preference change |
@@ -835,8 +835,7 @@ public void dispose() { |
835 | 835 | partListener = null; |
836 | 836 | } |
837 | 837 | if (prefListener != null) { |
838 | | - ResourcesPlugin.getPlugin().getPluginPreferences() |
839 | | - .removePropertyChangeListener(prefListener); |
| 838 | + InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES).removePreferenceChangeListener(prefListener); |
840 | 839 | prefListener = null; |
841 | 840 | } |
842 | 841 | if (propPrefListener != null) { |
|
0 commit comments