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
protected CommonViewer _viewer;
	protected CommonNavigator _commonNavigator;
	protected INavigatorContentService _contentService;
	protected NavigatorActionService _actionService;
	protected boolean _initTestData = true;
	protected static final boolean DEBUG = false;
	protected void setUp() throws Exception {
		if (_navigatorInstanceId == null) {
			throw new RuntimeException("Set the _navigatorInstanceId in the constructor");
		}
		
		if (!_navigatorInstanceId.equals(ProjectExplorer.VIEW_ID))
			EditorTestHelper.showView(ProjectExplorer.VIEW_ID, false);
		TestContentProviderPipelined.resetTest();
		TestContentProviderResource.resetTest();
		TestSorterData.resetTest();
		TestSorterResource.resetTest();
		TestLabelProvider.resetTest();
		TestDragAssistant.resetTest();
		if (_initTestData) {
			clearAll();
			TestWorkspace.init();
			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
			_project = root.getProject("Test"); 
			_expectedChildren.add(_project.getFolder("src")); 
			_expectedChildren.add(_project.getFolder("bin")); 
			_expectedChildren.add(_project.getFile(".project")); 
			_expectedChildren.add(_project.getFile(".classpath"));  
			_expectedChildren.add(_project.getFile("model.properties")); 
			_p1 = ResourcesPlugin.getWorkspace().getRoot().getProject("p1");