Bug 151958 [Markers] Custom problem filter not updated
- create a minimal plugin with a plugin.xml like this: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.2"?> <plugin> <extension point="org.eclipse.ui.ide.markerSupport"> <problemFilter name="Problems" id="markererror.myPlugin.filterId" enabled="true" scope="ON_ANY_IN_SAME_CONTAINER"> <selectedType/> </problemFilter> </extension> </plugin> - start a runtime workbench, introduce a compile error in a Java class to get a problem marker. - in the problems view, disable the default filter, the filter "Problems" remains activated. - no markers are shown in the problem view. I debugged a little and found that the method MarkerFilter.setFocusResource() is only called for the default filter, not for the plugin-defined "Problems" filter: The latter filter is only contained in the field MarkerView.enabledFilters. The field MarkerView.markerFilters contains only the default filter.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerView.java
ConcreteMarker element = (ConcreteMarker) markerIterator
								.next();
						newSelection.add(element.getResource());
					}
					return new ShowInContext(getViewer().getInput(),
							new StructuredSelection(newSelection));
				}
			};
		}
		return super.getAdapter(adaptable);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.views.markers.internal.TableView#viewerSelectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
	 */
	protected void viewerSelectionChanged(IStructuredSelection selection) {
		Object[] rawSelection = selection.toArray();
		List markers = new ArrayList();
		for (int idx = 0; idx < rawSelection.length; idx++) {
			if (rawSelection[idx] instanceof ConcreteMarker)
				markers.add(((ConcreteMarker) rawSelection[idx]).getMarker());
		}
		setSelection(new StructuredSelection(markers));
		updateStatusMessage(selection);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.views.internal.tableview.TableView#dispose()