本文整理匯總了Java中org.eclipse.ui.preferences.ScopedPreferenceStore.addPropertyChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ScopedPreferenceStore.addPropertyChangeListener方法的具體用法?Java ScopedPreferenceStore.addPropertyChangeListener怎麽用?Java ScopedPreferenceStore.addPropertyChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.preferences.ScopedPreferenceStore
的用法示例。
在下文中一共展示了ScopedPreferenceStore.addPropertyChangeListener方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: SynchronizeLabelDecorator
import org.eclipse.ui.preferences.ScopedPreferenceStore; //導入方法依賴的package包/類
public SynchronizeLabelDecorator(final Subscriber subscriber) {
this.subscriber = subscriber;
preferenceStore = new ScopedPreferenceStore(new InstanceScope(), TEAM_UI_PLUGIN_ID);
decorate = Boolean.TRUE.equals(preferenceStore.getBoolean(DECORATION_PREFERENCE_CONSTANT));
preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
if (event.getProperty().equals(DECORATION_PREFERENCE_CONSTANT)) {
/*
* Note that we compare against the string value of the
* preference here. Preferences are not strongly typed
* (they're strings under the hood), so in the property
* change event, we're given the string value.
*/
decorate = "true".equals(event.getNewValue()); //$NON-NLS-1$
((ILabelProviderListener) listeners.getListener()).labelProviderChanged(
new LabelProviderChangedEvent(SynchronizeLabelDecorator.this));
}
}
});
}
示例2: SearchLabelProvider
import org.eclipse.ui.preferences.ScopedPreferenceStore; //導入方法依賴的package包/類
public SearchLabelProvider(JavaSearchResultPage page) {
super(DEFAULT_SEARCH_TEXTFLAGS, DEFAULT_SEARCH_IMAGEFLAGS);
addLabelDecorator(new ProblemsLabelDecorator(null));
fPage= page;
fLabelProviderMap= new HashMap<IMatchPresentation, ILabelProvider>(5);
fSearchPreferences= new ScopedPreferenceStore(InstanceScope.INSTANCE, NewSearchUI.PLUGIN_ID);
fSearchPropertyListener= new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
doSearchPropertyChange(event);
}
};
fSearchPreferences.addPropertyChangeListener(fSearchPropertyListener);
}
示例3: addPreferenceListener
import org.eclipse.ui.preferences.ScopedPreferenceStore; //導入方法依賴的package包/類
public void addPreferenceListener(IPropertyChangeListener plistener) {
listeners.add(plistener);
getPreferenceStore().addPropertyChangeListener(plistener);
for (ScopedPreferenceStore p : pstores)
p.addPropertyChangeListener(plistener);
}