當前位置: 首頁>>代碼示例>>Java>>正文


Java ScopedPreferenceStore.addPropertyChangeListener方法代碼示例

本文整理匯總了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));
            }
        }
    });
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:26,代碼來源:SynchronizeLabelDecorator.java

示例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);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:16,代碼來源:SearchLabelProvider.java

示例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);
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:7,代碼來源:AbstractJRUIPlugin.java


注:本文中的org.eclipse.ui.preferences.ScopedPreferenceStore.addPropertyChangeListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。