Lines 20-25
Link Here
|
20 |
import java.util.List; |
20 |
import java.util.List; |
21 |
|
21 |
|
22 |
import org.eclipse.jface.preference.IPreferenceStore; |
22 |
import org.eclipse.jface.preference.IPreferenceStore; |
|
|
23 |
import org.eclipse.jface.util.IPropertyChangeListener; |
24 |
import org.eclipse.jface.util.PropertyChangeEvent; |
23 |
import org.eclipse.ui.IMemento; |
25 |
import org.eclipse.ui.IMemento; |
24 |
import org.eclipse.ui.WorkbenchException; |
26 |
import org.eclipse.ui.WorkbenchException; |
25 |
import org.eclipse.ui.XMLMemento; |
27 |
import org.eclipse.ui.XMLMemento; |
Lines 34-39
Link Here
|
34 |
PreferenceCommandRegistry(IPreferenceStore preferenceStore) { |
36 |
PreferenceCommandRegistry(IPreferenceStore preferenceStore) { |
35 |
if (preferenceStore == null) |
37 |
if (preferenceStore == null) |
36 |
throw new NullPointerException(); |
38 |
throw new NullPointerException(); |
|
|
39 |
|
40 |
/* Attach a listener to make sure that a re-load is performed if the |
41 |
* underlying preferences changes. |
42 |
*/ |
43 |
preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() { |
44 |
public final void propertyChange(final PropertyChangeEvent event) { |
45 |
final String property = event.getProperty(); |
46 |
if ((property != null) && (KEY.equals(property))) { |
47 |
try { |
48 |
load(); |
49 |
} catch (final IOException e) { |
50 |
e.printStackTrace(); |
51 |
} |
52 |
} |
53 |
} |
54 |
}); |
37 |
|
55 |
|
38 |
this.preferenceStore = preferenceStore; |
56 |
this.preferenceStore = preferenceStore; |
39 |
} |
57 |
} |