Search in sources :

Example 1 with CommonFilterDescriptorManager

use of org.eclipse.ui.internal.navigator.filters.CommonFilterDescriptorManager in project polymap4-core by Polymap4.

the class NavigatorFilterService method persistFilterActivationState.

/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.navigator.INavigatorFilterService#persistFilterActivationState()
	 */
public void persistFilterActivationState() {
    synchronized (activeFilters) {
        CommonFilterDescriptorManager dm = CommonFilterDescriptorManager.getInstance();
        /*
			 * by creating a StringBuffer with DELIM, we ensure the string is
			 * not empty when persisted.
			 */
        StringBuffer activatedFiltersPreferenceValue = new StringBuffer(DELIM);
        for (Iterator activeItr = activeFilters.iterator(); activeItr.hasNext(); ) {
            String id = activeItr.next().toString();
            if (!dm.getFilterById(id).isVisibleInUi())
                continue;
            activatedFiltersPreferenceValue.append(id).append(DELIM);
        }
        IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot();
        prefs.put(getFilterActivationPreferenceKey(), activatedFiltersPreferenceValue.toString());
        NavigatorContentService.flushPreferences(prefs);
    }
}
Also used : CommonFilterDescriptorManager(org.eclipse.ui.internal.navigator.filters.CommonFilterDescriptorManager) IEclipsePreferences(org.eclipse.core.runtime.preferences.IEclipsePreferences) Iterator(java.util.Iterator)

Aggregations

Iterator (java.util.Iterator)1 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)1 CommonFilterDescriptorManager (org.eclipse.ui.internal.navigator.filters.CommonFilterDescriptorManager)1