Skip to content
Open
Show file tree
Hide file tree
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
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.runtime.preferences.UserScope;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.di.extensions.Preference;
import org.eclipse.e4.core.services.events.IEventBroker;
Expand Down Expand Up @@ -53,6 +54,7 @@ public class PreferenceSpyAddon {
private final IEclipsePreferences configurationScopePreferences = ConfigurationScope.INSTANCE.getNode("");
private final IEclipsePreferences defaultScopePreferences = DefaultScope.INSTANCE.getNode("");
private final IEclipsePreferences instanceScopePreferences = InstanceScope.INSTANCE.getNode("");
private final IEclipsePreferences userScopePreferences = UserScope.INSTANCE.getNode("");

private final ChangedPreferenceListener preferenceChangedListener = new ChangedPreferenceListener();

Expand All @@ -72,6 +74,7 @@ private void registerVisitors() {
addPreferenceListener(configurationScopePreferences);
addPreferenceListener(defaultScopePreferences);
addPreferenceListener(instanceScopePreferences);
addPreferenceListener(userScopePreferences);
}

private void addPreferenceListener(IEclipsePreferences rootPreference) {
Expand All @@ -90,6 +93,7 @@ private void deregisterVisitors() {
removePreferenceListener(configurationScopePreferences);
removePreferenceListener(defaultScopePreferences);
removePreferenceListener(instanceScopePreferences);
removePreferenceListener(userScopePreferences);
}

private void removePreferenceListener(IEclipsePreferences rootPreference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.runtime.preferences.UserScope;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.jface.dialogs.ErrorDialog;
Expand Down Expand Up @@ -54,6 +55,7 @@ public void execute(Shell shell, IEventBroker eventBroker) {
ConfigurationScope.INSTANCE.getNode("").accept(gatherer);
DefaultScope.INSTANCE.getNode("").accept(gatherer);
InstanceScope.INSTANCE.getNode("").accept(gatherer);
UserScope.INSTANCE.getNode("").accept(gatherer);
} catch (BackingStoreException e) {
ErrorDialog.openError(shell, "BackingStoreException", e.getLocalizedMessage(),
Status.error(e.getMessage()));
Expand Down
Loading