Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 96600 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/IWorkbenchConstants.java (+14 lines)
Lines 79-84 Link Here
79
79
80
    public static final String PL_SYSTEM_SUMMARY_SECTIONS = "systemSummarySections"; //$NON-NLS-1$
80
    public static final String PL_SYSTEM_SUMMARY_SECTIONS = "systemSummarySections"; //$NON-NLS-1$
81
    
81
    
82
    public static final String PL_BINDINGS = "bindings"; //$NON-NLS-1$
83
    
84
    public static final String PL_ACCELERATOR_CONFIGURATIONS = "acceleratorConfigurations"; //$NON-NLS-1$
85
    
86
    public static final String PL_COMMANDS = "commands"; //$NON-NLS-1$
87
    
88
    public static final String PL_CONTEXTS = "contexts"; //$NON-NLS-1$
89
    
90
    public static final String PL_ACCELERATOR_SCOPES = "acceleratorScopes"; //$NON-NLS-1$
91
    
92
    public static final String PL_ACTION_DEFINITIONS = "actionDefinitions"; //$NON-NLS-1$
93
    
94
    public static final String PL_HANDLERS = "handlers"; //$NON-NLS-1$
95
    
82
    /**
96
    /**
83
     * The extension point for encoding definitions.
97
     * The extension point for encoding definitions.
84
     */
98
     */
(-)Eclipse UI/org/eclipse/ui/internal/commands/CommandPersistence.java (-2 / +57 lines)
Lines 18-28 Link Here
18
import org.eclipse.core.commands.Command;
18
import org.eclipse.core.commands.Command;
19
import org.eclipse.core.commands.CommandManager;
19
import org.eclipse.core.commands.CommandManager;
20
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.core.runtime.IExtensionDelta;
21
import org.eclipse.core.runtime.IExtensionRegistry;
22
import org.eclipse.core.runtime.IExtensionRegistry;
23
import org.eclipse.core.runtime.IRegistryChangeEvent;
24
import org.eclipse.core.runtime.IRegistryChangeListener;
22
import org.eclipse.core.runtime.IStatus;
25
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.MultiStatus;
26
import org.eclipse.core.runtime.MultiStatus;
24
import org.eclipse.core.runtime.Platform;
27
import org.eclipse.core.runtime.Platform;
25
import org.eclipse.core.runtime.Status;
28
import org.eclipse.core.runtime.Status;
29
import org.eclipse.swt.widgets.Display;
30
import org.eclipse.ui.PlatformUI;
31
import org.eclipse.ui.internal.IWorkbenchConstants;
26
import org.eclipse.ui.internal.WorkbenchPlugin;
32
import org.eclipse.ui.internal.WorkbenchPlugin;
27
import org.eclipse.ui.internal.util.Util;
33
import org.eclipse.ui.internal.util.Util;
28
34
Lines 95-106 Link Here
95
	/**
101
	/**
96
	 * The name of the action definitions extension point.
102
	 * The name of the action definitions extension point.
97
	 */
103
	 */
98
	private static final String EXTENSION_ACTION_DEFINITIONS = "org.eclipse.ui.actionDefinitions"; //$NON-NLS-1$
104
	private static final String EXTENSION_ACTION_DEFINITIONS = PlatformUI.PLUGIN_ID
105
			+ '.' + IWorkbenchConstants.PL_ACTION_DEFINITIONS;
99
106
100
	/**
107
	/**
101
	 * The name of the commands extension point.
108
	 * The name of the commands extension point.
102
	 */
109
	 */
103
	private static final String EXTENSION_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$
110
	private static final String EXTENSION_COMMANDS = PlatformUI.PLUGIN_ID + '.'
111
			+ IWorkbenchConstants.PL_COMMANDS;
104
112
105
	/**
113
	/**
106
	 * The index of the category elements in the indexed array.
114
	 * The index of the category elements in the indexed array.
Lines 117-122 Link Here
117
	private static final int INDEX_COMMAND_DEFINITIONS = 1;
125
	private static final int INDEX_COMMAND_DEFINITIONS = 1;
118
126
119
	/**
127
	/**
128
	 * Whether the preference and registry change listeners have been attached
129
	 * yet.
130
	 */
131
    private static boolean listenersAttached = false;
132
133
	/**
120
	 * Inserts the given element into the indexed two-dimensional array in the
134
	 * Inserts the given element into the indexed two-dimensional array in the
121
	 * array at the index. The array is grown as necessary.
135
	 * array at the index. The array is grown as necessary.
122
	 * 
136
	 * 
Lines 205-210 Link Here
205
		readCommandsFromCommandsExtensionPoint(
219
		readCommandsFromCommandsExtensionPoint(
206
				indexedConfigurationElements[INDEX_COMMAND_DEFINITIONS],
220
				indexedConfigurationElements[INDEX_COMMAND_DEFINITIONS],
207
				commandDefinitionCount, commandManager);
221
				commandDefinitionCount, commandManager);
222
		
223
        /*
224
		 * Adds listener so that future registry changes trigger an update of
225
		 * the command manager automatically.
226
		 */
227
		if (!listenersAttached) {
228
			registry.addRegistryChangeListener(new IRegistryChangeListener() {
229
				public final void registryChanged(
230
						final IRegistryChangeEvent event) {
231
					final IExtensionDelta[] acceleratorConfigurationDeltas = event
232
							.getExtensionDeltas(
233
									PlatformUI.PLUGIN_ID,
234
									IWorkbenchConstants.PL_ACCELERATOR_CONFIGURATIONS);
235
					if (acceleratorConfigurationDeltas.length == 0) {
236
						final IExtensionDelta[] bindingDeltas = event
237
								.getExtensionDeltas(PlatformUI.PLUGIN_ID,
238
										IWorkbenchConstants.PL_BINDINGS);
239
						if (bindingDeltas.length == 0) {
240
							final IExtensionDelta[] commandDeltas = event
241
									.getExtensionDeltas(PlatformUI.PLUGIN_ID,
242
											IWorkbenchConstants.PL_COMMANDS);
243
							if (commandDeltas.length == 0) {
244
								return;
245
							}
246
						}
247
					}
248
249
					/*
250
					 * At least one of the deltas is non-zero, so re-read all of
251
					 * the bindings.
252
					 */
253
					Display.getDefault().asyncExec(new Runnable() {
254
						public void run() {
255
							read(commandManager);
256
						}
257
					});
258
				}
259
			}, PlatformUI.PLUGIN_ID);
260
261
			listenersAttached = true;
262
		}
208
	}
263
	}
209
264
210
	/**
265
	/**
(-)Eclipse UI/org/eclipse/ui/internal/contexts/ContextPersistence.java (-3 / +59 lines)
Lines 17-27 Link Here
17
import org.eclipse.core.commands.contexts.Context;
17
import org.eclipse.core.commands.contexts.Context;
18
import org.eclipse.core.commands.contexts.ContextManager;
18
import org.eclipse.core.commands.contexts.ContextManager;
19
import org.eclipse.core.runtime.IConfigurationElement;
19
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IExtensionDelta;
20
import org.eclipse.core.runtime.IExtensionRegistry;
21
import org.eclipse.core.runtime.IExtensionRegistry;
22
import org.eclipse.core.runtime.IRegistryChangeEvent;
23
import org.eclipse.core.runtime.IRegistryChangeListener;
21
import org.eclipse.core.runtime.IStatus;
24
import org.eclipse.core.runtime.IStatus;
22
import org.eclipse.core.runtime.MultiStatus;
25
import org.eclipse.core.runtime.MultiStatus;
23
import org.eclipse.core.runtime.Platform;
26
import org.eclipse.core.runtime.Platform;
24
import org.eclipse.core.runtime.Status;
27
import org.eclipse.core.runtime.Status;
28
import org.eclipse.swt.widgets.Display;
29
import org.eclipse.ui.PlatformUI;
30
import org.eclipse.ui.internal.IWorkbenchConstants;
25
import org.eclipse.ui.internal.WorkbenchPlugin;
31
import org.eclipse.ui.internal.WorkbenchPlugin;
26
32
27
/**
33
/**
Lines 85-101 Link Here
85
	/**
91
	/**
86
	 * The name of the accelerator scopes extension point.
92
	 * The name of the accelerator scopes extension point.
87
	 */
93
	 */
88
	private static final String EXTENSION_ACCELERATOR_SCOPES = "org.eclipse.ui.acceleratorScopes"; //$NON-NLS-1$
94
	private static final String EXTENSION_ACCELERATOR_SCOPES = PlatformUI.PLUGIN_ID
95
			+ '.' + IWorkbenchConstants.PL_ACCELERATOR_SCOPES;
89
96
90
	/**
97
	/**
91
	 * The name of the commands extension point.
98
	 * The name of the commands extension point.
92
	 */
99
	 */
93
	private static final String EXTENSION_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$
100
	private static final String EXTENSION_COMMANDS = PlatformUI.PLUGIN_ID + '.'
101
			+ IWorkbenchConstants.PL_COMMANDS;
94
102
95
	/**
103
	/**
96
	 * The name of the contexts extension point.
104
	 * The name of the contexts extension point.
97
	 */
105
	 */
98
	private static final String EXTENSION_CONTEXTS = "org.eclipse.ui.contexts"; //$NON-NLS-1$
106
	private static final String EXTENSION_CONTEXTS = PlatformUI.PLUGIN_ID + '.'
107
			+ IWorkbenchConstants.PL_CONTEXTS;
99
108
100
	/**
109
	/**
101
	 * The index of the context elements in the indexed array.
110
	 * The index of the context elements in the indexed array.
Lines 105-110 Link Here
105
	private static final int INDEX_CONTEXT_DEFINITIONS = 0;
114
	private static final int INDEX_CONTEXT_DEFINITIONS = 0;
106
115
107
	/**
116
	/**
117
	 * Whether the preference and registry change listeners have been attached
118
	 * yet.
119
	 */
120
    private static boolean listenersAttached = false;
121
122
	/**
108
	 * Inserts the given element into the indexed two-dimensional array in the
123
	 * Inserts the given element into the indexed two-dimensional array in the
109
	 * array at the index. The array is grown as necessary.
124
	 * array at the index. The array is grown as necessary.
110
	 * 
125
	 * 
Lines 215-220 Link Here
215
		readContextsFromExtensionPoint(
230
		readContextsFromExtensionPoint(
216
				indexedConfigurationElements[INDEX_CONTEXT_DEFINITIONS],
231
				indexedConfigurationElements[INDEX_CONTEXT_DEFINITIONS],
217
				contextDefinitionCount, contextManager);
232
				contextDefinitionCount, contextManager);
233
		
234
        /*
235
		 * Adds listener so that future registry changes trigger an update of
236
		 * the command manager automatically.
237
		 */
238
		if (!listenersAttached) {
239
			registry.addRegistryChangeListener(new IRegistryChangeListener() {
240
				public final void registryChanged(
241
						final IRegistryChangeEvent event) {
242
					final IExtensionDelta[] acceleratorConfigurationDeltas = event
243
							.getExtensionDeltas(
244
									PlatformUI.PLUGIN_ID,
245
									IWorkbenchConstants.PL_ACCELERATOR_CONFIGURATIONS);
246
					if (acceleratorConfigurationDeltas.length == 0) {
247
						final IExtensionDelta[] bindingDeltas = event
248
								.getExtensionDeltas(PlatformUI.PLUGIN_ID,
249
										IWorkbenchConstants.PL_BINDINGS);
250
						if (bindingDeltas.length == 0) {
251
							final IExtensionDelta[] commandDeltas = event
252
									.getExtensionDeltas(PlatformUI.PLUGIN_ID,
253
											IWorkbenchConstants.PL_COMMANDS);
254
							if (commandDeltas.length == 0) {
255
								return;
256
							}
257
						}
258
					}
259
260
					/*
261
					 * At least one of the deltas is non-zero, so re-read all of
262
					 * the bindings.
263
					 */
264
					Display.getDefault().asyncExec(new Runnable() {
265
						public void run() {
266
							read(contextManager);
267
						}
268
					});
269
				}
270
			}, PlatformUI.PLUGIN_ID);
271
272
			listenersAttached = true;
273
		}
218
	}
274
	}
219
275
220
	/**
276
	/**
(-)Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java (-2 / +57 lines)
Lines 19-31 Link Here
19
import org.eclipse.core.expressions.ExpressionConverter;
19
import org.eclipse.core.expressions.ExpressionConverter;
20
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.CoreException;
21
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.core.runtime.IConfigurationElement;
22
import org.eclipse.core.runtime.IExtensionDelta;
22
import org.eclipse.core.runtime.IExtensionRegistry;
23
import org.eclipse.core.runtime.IExtensionRegistry;
24
import org.eclipse.core.runtime.IRegistryChangeEvent;
25
import org.eclipse.core.runtime.IRegistryChangeListener;
23
import org.eclipse.core.runtime.IStatus;
26
import org.eclipse.core.runtime.IStatus;
24
import org.eclipse.core.runtime.MultiStatus;
27
import org.eclipse.core.runtime.MultiStatus;
25
import org.eclipse.core.runtime.Platform;
28
import org.eclipse.core.runtime.Platform;
26
import org.eclipse.core.runtime.Status;
29
import org.eclipse.core.runtime.Status;
30
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.ui.ISources;
31
import org.eclipse.ui.ISources;
32
import org.eclipse.ui.PlatformUI;
28
import org.eclipse.ui.handlers.IHandlerService;
33
import org.eclipse.ui.handlers.IHandlerService;
34
import org.eclipse.ui.internal.IWorkbenchConstants;
29
import org.eclipse.ui.internal.WorkbenchPlugin;
35
import org.eclipse.ui.internal.WorkbenchPlugin;
30
36
31
/**
37
/**
Lines 100-111 Link Here
100
	/**
106
	/**
101
	 * The name of the commands extension point.
107
	 * The name of the commands extension point.
102
	 */
108
	 */
103
	private static final String EXTENSION_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$
109
	private static final String EXTENSION_COMMANDS = PlatformUI.PLUGIN_ID + '.'
110
			+ IWorkbenchConstants.PL_COMMANDS;
104
111
105
	/**
112
	/**
106
	 * The name of the commands extension point.
113
	 * The name of the commands extension point.
107
	 */
114
	 */
108
	private static final String EXTENSION_HANDLERS = "org.eclipse.ui.handlers"; //$NON-NLS-1$
115
	private static final String EXTENSION_HANDLERS = PlatformUI.PLUGIN_ID + '.'
116
			+ IWorkbenchConstants.PL_HANDLERS;
109
117
110
	/**
118
	/**
111
	 * The index of the command elements in the indexed array.
119
	 * The index of the command elements in the indexed array.
Lines 129-134 Link Here
129
	private static final int INDEX_HANDLER_SUBMISSIONS = 2;
137
	private static final int INDEX_HANDLER_SUBMISSIONS = 2;
130
138
131
	/**
139
	/**
140
	 * Whether the preference and registry change listeners have been attached
141
	 * yet.
142
	 */
143
    private static boolean listenersAttached = false;
144
145
	/**
132
	 * Inserts the given element into the indexed two-dimensional array in the
146
	 * Inserts the given element into the indexed two-dimensional array in the
133
	 * array at the index. The array is grown as necessary.
147
	 * array at the index. The array is grown as necessary.
134
	 * 
148
	 * 
Lines 223-228 Link Here
223
		readHandlersFromHandlersExtensionPoint(
237
		readHandlersFromHandlersExtensionPoint(
224
				indexedConfigurationElements[INDEX_HANDLER_DEFINITIONS],
238
				indexedConfigurationElements[INDEX_HANDLER_DEFINITIONS],
225
				handlerDefinitionCount, handlerService);
239
				handlerDefinitionCount, handlerService);
240
		
241
		/*
242
		 * Adds listener so that future registry changes trigger an update of
243
		 * the command manager automatically.
244
		 */
245
		if (!listenersAttached) {
246
			registry.addRegistryChangeListener(new IRegistryChangeListener() {
247
				public final void registryChanged(
248
						final IRegistryChangeEvent event) {
249
					final IExtensionDelta[] acceleratorConfigurationDeltas = event
250
							.getExtensionDeltas(
251
									PlatformUI.PLUGIN_ID,
252
									IWorkbenchConstants.PL_ACCELERATOR_CONFIGURATIONS);
253
					if (acceleratorConfigurationDeltas.length == 0) {
254
						final IExtensionDelta[] bindingDeltas = event
255
								.getExtensionDeltas(PlatformUI.PLUGIN_ID,
256
										IWorkbenchConstants.PL_BINDINGS);
257
						if (bindingDeltas.length == 0) {
258
							final IExtensionDelta[] commandDeltas = event
259
									.getExtensionDeltas(PlatformUI.PLUGIN_ID,
260
											IWorkbenchConstants.PL_COMMANDS);
261
							if (commandDeltas.length == 0) {
262
								return;
263
							}
264
						}
265
					}
266
267
					/*
268
					 * At least one of the deltas is non-zero, so re-read all of
269
					 * the bindings.
270
					 */
271
					Display.getDefault().asyncExec(new Runnable() {
272
						public void run() {
273
							read(handlerService);
274
						}
275
					});
276
				}
277
			}, PlatformUI.PLUGIN_ID);
278
279
			listenersAttached = true;
280
		}
226
	}
281
	}
227
282
228
	/**
283
	/**
(-)Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java (-22 / +74 lines)
Lines 29-35 Link Here
29
import org.eclipse.core.commands.ParameterizedCommand;
29
import org.eclipse.core.commands.ParameterizedCommand;
30
import org.eclipse.core.commands.common.NotDefinedException;
30
import org.eclipse.core.commands.common.NotDefinedException;
31
import org.eclipse.core.runtime.IConfigurationElement;
31
import org.eclipse.core.runtime.IConfigurationElement;
32
import org.eclipse.core.runtime.IExtensionDelta;
32
import org.eclipse.core.runtime.IExtensionRegistry;
33
import org.eclipse.core.runtime.IExtensionRegistry;
34
import org.eclipse.core.runtime.IRegistryChangeEvent;
35
import org.eclipse.core.runtime.IRegistryChangeListener;
33
import org.eclipse.core.runtime.IStatus;
36
import org.eclipse.core.runtime.IStatus;
34
import org.eclipse.core.runtime.MultiStatus;
37
import org.eclipse.core.runtime.MultiStatus;
35
import org.eclipse.core.runtime.Platform;
38
import org.eclipse.core.runtime.Platform;
Lines 50-61 Link Here
50
import org.eclipse.jface.util.PropertyChangeEvent;
53
import org.eclipse.jface.util.PropertyChangeEvent;
51
import org.eclipse.jface.util.Util;
54
import org.eclipse.jface.util.Util;
52
import org.eclipse.swt.SWT;
55
import org.eclipse.swt.SWT;
56
import org.eclipse.swt.widgets.Display;
53
import org.eclipse.ui.IMemento;
57
import org.eclipse.ui.IMemento;
54
import org.eclipse.ui.IWorkbenchPreferenceConstants;
58
import org.eclipse.ui.IWorkbenchPreferenceConstants;
55
import org.eclipse.ui.PlatformUI;
59
import org.eclipse.ui.PlatformUI;
56
import org.eclipse.ui.WorkbenchException;
60
import org.eclipse.ui.WorkbenchException;
57
import org.eclipse.ui.XMLMemento;
61
import org.eclipse.ui.XMLMemento;
58
import org.eclipse.ui.commands.ICommandService;
62
import org.eclipse.ui.commands.ICommandService;
63
import org.eclipse.ui.internal.IWorkbenchConstants;
59
import org.eclipse.ui.internal.WorkbenchPlugin;
64
import org.eclipse.ui.internal.WorkbenchPlugin;
60
import org.eclipse.ui.internal.misc.Policy;
65
import org.eclipse.ui.internal.misc.Policy;
61
import org.eclipse.ui.keys.IBindingService;
66
import org.eclipse.ui.keys.IBindingService;
Lines 231-248 Link Here
231
	/**
236
	/**
232
	 * The name of the deprecated accelerator configurations extension point.
237
	 * The name of the deprecated accelerator configurations extension point.
233
	 */
238
	 */
234
	private static final String EXTENSION_ACCELERATOR_CONFIGURATIONS = "org.eclipse.ui.acceleratorConfigurations"; //$NON-NLS-1$
239
	private static final String EXTENSION_ACCELERATOR_CONFIGURATIONS = PlatformUI.PLUGIN_ID
240
			+ '.' + IWorkbenchConstants.PL_ACCELERATOR_CONFIGURATIONS;
235
241
236
	/**
242
	/**
237
	 * The name of the bindings extension point.
243
	 * The name of the bindings extension point.
238
	 */
244
	 */
239
	private static final String EXTENSION_BINDINGS = "org.eclipse.ui.bindings"; //$NON-NLS-1$
245
	private static final String EXTENSION_BINDINGS = PlatformUI.PLUGIN_ID + '.'
246
			+ IWorkbenchConstants.PL_BINDINGS;
240
247
241
	/**
248
	/**
242
	 * The name of the commands extension point, and the name of the key for the
249
	 * The name of the commands extension point, and the name of the key for the
243
	 * commands preferences.
250
	 * commands preferences.
244
	 */
251
	 */
245
	private static final String EXTENSION_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$
252
	private static final String EXTENSION_COMMANDS = PlatformUI.PLUGIN_ID + '.'
253
			+ IWorkbenchConstants.PL_COMMANDS;
246
254
247
	/**
255
	/**
248
	 * The index of the active scheme configuration elements in the indexed
256
	 * The index of the active scheme configuration elements in the indexed
Lines 274-288 Link Here
274
	private static final String LEGACY_DEFAULT_SCOPE = "org.eclipse.ui.globalScope"; //$NON-NLS-1$
282
	private static final String LEGACY_DEFAULT_SCOPE = "org.eclipse.ui.globalScope"; //$NON-NLS-1$
275
283
276
	/**
284
	/**
285
	 * Whether the preference and registry change listeners have been attached
286
	 * yet.
287
	 */
288
    private static boolean listenersAttached = false;
289
    
290
    /**
277
	 * A look-up map for 2.1.x style <code>string</code> keys on a
291
	 * A look-up map for 2.1.x style <code>string</code> keys on a
278
	 * <code>keyBinding</code> element.
292
	 * <code>keyBinding</code> element.
279
	 */
293
	 */
280
	private static final Map r2_1KeysByName = new HashMap();
294
	private static final Map r2_1KeysByName = new HashMap();
281
    
282
    /**
283
     * Whether the property change listener has been attached yet.
284
     */
285
    private static boolean propertyChangeListenerAttached = false;
286
295
287
	static {
296
	static {
288
		final IKeyLookup lookup = KeyLookupFactory.getDefault();
297
		final IKeyLookup lookup = KeyLookupFactory.getDefault();
Lines 642-660 Link Here
642
                commandService);
651
                commandService);
643
652
644
        /*
653
        /*
645
         * Add a listener so that future preference changes trigger an update of
654
		 * Adds listener so that future preference and registry changes trigger
646
         * the binding manager automatically.
655
		 * an update of the binding manager automatically.
647
         */
656
		 */
648
        if (!propertyChangeListenerAttached) {
657
        if (!listenersAttached) {
649
            store.addPropertyChangeListener(new IPropertyChangeListener() {
658
			store.addPropertyChangeListener(new IPropertyChangeListener() {
650
                public void propertyChange(PropertyChangeEvent event) {
659
				public final void propertyChange(final PropertyChangeEvent event) {
651
                    if (EXTENSION_COMMANDS.equals(event.getProperty())) {
660
					if (EXTENSION_COMMANDS.equals(event.getProperty())) {
652
                        read(bindingManager, commandService);
661
						read(bindingManager, commandService);
653
                    }
662
					}
654
                }
663
				}
655
            });
664
			});
656
            propertyChangeListenerAttached = true;
665
657
        }
666
			registry.addRegistryChangeListener(new IRegistryChangeListener() {
667
				public final void registryChanged(
668
						final IRegistryChangeEvent event) {
669
					final IExtensionDelta[] acceleratorConfigurationDeltas = event
670
							.getExtensionDeltas(
671
									PlatformUI.PLUGIN_ID,
672
									IWorkbenchConstants.PL_ACCELERATOR_CONFIGURATIONS);
673
					if (acceleratorConfigurationDeltas.length == 0) {
674
						final IExtensionDelta[] bindingDeltas = event
675
								.getExtensionDeltas(PlatformUI.PLUGIN_ID,
676
										IWorkbenchConstants.PL_BINDINGS);
677
						if (bindingDeltas.length == 0) {
678
							final IExtensionDelta[] commandDeltas = event
679
									.getExtensionDeltas(PlatformUI.PLUGIN_ID,
680
											IWorkbenchConstants.PL_COMMANDS);
681
							if (commandDeltas.length == 0) {
682
								return;
683
							}
684
						}
685
					}
686
					
687
					/*
688
					 * At least one of the deltas is non-zero, so re-read all of
689
					 * the bindings.
690
					 */
691
					Display.getDefault().asyncExec(new Runnable() {
692
						public void run() {
693
							read(bindingManager, commandService);
694
						}
695
					});
696
				}
697
			}, PlatformUI.PLUGIN_ID);
698
699
			listenersAttached = true;
700
		}
658
    }
701
    }
659
702
660
703
Lines 778-784 Link Here
778
							.getScheme(IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID));
821
							.getScheme(IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID));
779
		} catch (final NotDefinedException e) {
822
		} catch (final NotDefinedException e) {
780
			// Damn, we're fucked.
823
			// Damn, we're fucked.
781
			throw new Error("You cannot make something from nothing"); //$NON-NLS-1$
824
			throw new Error(
825
					"The default default active scheme id is not defined."); //$NON-NLS-1$
782
		}
826
		}
783
	}
827
	}
784
828
Lines 1365-1370 Link Here
1365
			final IConfigurationElement[] configurationElements,
1409
			final IConfigurationElement[] configurationElements,
1366
			final int configurationElementCount,
1410
			final int configurationElementCount,
1367
			final BindingManager bindingManager) {
1411
			final BindingManager bindingManager) {
1412
		// Undefine all the previous schemes.
1413
		final Scheme[] schemes = bindingManager.getDefinedSchemes();
1414
		if (schemes != null) {
1415
			for (int i = 0; i < schemes.length; i++) {
1416
				schemes[i].undefine();
1417
			}
1418
		}
1419
		
1368
		for (int i = 0; i < configurationElementCount; i++) {
1420
		for (int i = 0; i < configurationElementCount; i++) {
1369
			final IConfigurationElement configurationElement = configurationElements[i];
1421
			final IConfigurationElement configurationElement = configurationElements[i];
1370
1422

Return to bug 96600