Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -27,7 +27,8 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
Expand Down Expand Up @@ -214,7 +215,7 @@ public class WorkbenchActionBuilder extends ActionBarAdvisor {
// @issue class is workbench internal
private StatusLineContributionItem statusLineItem;

private Preferences.IPropertyChangeListener prefListener;
private IEclipsePreferences.IPreferenceChangeListener prefListener;

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

prefListener = event -> {
if (event.getProperty().equals(
ResourcesPlugin.PREF_AUTO_BUILDING)) {
if (event.getKey().equals(ResourcesPlugin.PREF_AUTO_BUILDING)) {
updateBuildActions(false);
}
};
ResourcesPlugin.getPlugin().getPluginPreferences()
.addPropertyChangeListener(prefListener);
InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES)
.addPreferenceChangeListener(prefListener);

// listener for the "close editors automatically"
// preference change
Expand Down Expand Up @@ -835,8 +835,7 @@ public void dispose() {
partListener = null;
}
if (prefListener != null) {
ResourcesPlugin.getPlugin().getPluginPreferences()
.removePropertyChangeListener(prefListener);
InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES).removePreferenceChangeListener(prefListener);
prefListener = null;
}
if (propPrefListener != null) {
Expand Down Expand Up @@ -1535,11 +1534,13 @@ private IContributionItem getItem(String actionId, String commandId,
.getService(IActionCommandMappingService.class);
acms.map(actionId, commandId);

CommandContributionItemParameter commandParm = new CommandContributionItemParameter(
getWindow(), actionId, commandId, null, sharedImages
.getImageDescriptor(image), sharedImages
.getImageDescriptor(disabledImage), null, label, null,
tooltip, CommandContributionItem.STYLE_PUSH, null, false);
CommandContributionItemParameter commandParm = new CommandContributionItemParameter(getWindow(), actionId,
commandId, CommandContributionItem.STYLE_PUSH);

commandParm.icon = sharedImages.getImageDescriptor(image);
commandParm.disabledIcon = sharedImages.getImageDescriptor(disabledImage);
commandParm.label = label;
commandParm.tooltip = tooltip;
return new CommandContributionItem(commandParm);
}
}
Loading