Bug 292813 [CommonNavigator] Please provide an API for enabling and disabling common navigator filters programmatically
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0 Build Identifier: M20090917-0800 Recently I had a case where I wanted to enable/disable a common navigator filter from code and found it very difficult. I basically ended up using the code in org.eclipse.ui.internal.navigator.filters.UpdateActiveFiltersOperation as a reference and ended up manually creating or pruning an array, as well as adding/removing a corresponding ViewerFilter to/from and refreshing the underlying viewer. This seems quite complicated and I think others could benefit from it being API similar to how API was recently added to enable and disable content contributions (via INavigatorContentService#activateExtensions and INavigatorContentService#deactivateExtensions). Reproducible: Always
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/NavigatorTestBase.java
_p1.open(null);
			_p2 = ResourcesPlugin.getWorkspace().getRoot().getProject("p2");
			_p2.open(null);
			_projectCount = 3;
		}
		showNavigator();
		refreshViewer();
		_contentService = _viewer.getNavigatorContentService();
		_actionService = _commonNavigator.getNavigatorActionService();
		((NavigatorFilterService) _contentService.getFilterService()).resetFilterActivationState();
	}
	protected void lookAt() {
		DisplayHelper.sleep(1000000);
	}
	
	protected void waitForModelObjects() throws Exception {
		_project.findMember(TestContentProvider.MODEL_FILE_PATH).touch(null);
		
		DisplayHelper.sleep(50);
	}
	protected void showNavigator() throws PartInitException {
		EditorTestHelper.showView(_navigatorInstanceId, true);
		IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		IWorkbenchPage activePage = activeWindow.getActivePage();
		_commonNavigator = (CommonNavigator) activePage.findView(_navigatorInstanceId);
		_commonNavigator.setFocus();
		_viewer = (CommonViewer) _commonNavigator.getAdapter(CommonViewer.class);
	}
	protected void tearDown() throws Exception {
		clearAll();