Bug 5231 Add search for field read and write references
The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java
fView.searchStarted(
				JavaSearchPage.EXTENSION_POINT_ID,
				fOperation.getDescription(),
				fOperation.getImageDescriptor(),
				fContextMenu,
				JavaSearchResultLabelProvider.INSTANCE,
				new GotoMarkerAction(),
				new GroupByKeyComputer(),
				fOperation);
		}
		if (!getProgressMonitor().isCanceled())
			getProgressMonitor().subTask(SEARCHING);
	}
	
	/**
	 * @see IJavaSearchResultCollector#accept
	 */
	public void accept(IResource resource, int start, int end, IJavaElement enclosingElement, int accuracy) throws CoreException {
		IMarker marker= resource.createMarker(SearchUI.SEARCH_MARKER);
		HashMap attributes;
		Object groupKey= enclosingElement;
		if (accuracy == POTENTIAL_MATCH) {
			attributes= new HashMap(6);
			attributes.put(IJavaSearchUIConstants.ATT_ACCURACY, POTENTIAL_MATCH_VALUE);
			if (groupKey == null)
				groupKey= "?:null";
			else
				groupKey= "?:" + enclosingElement.getHandleIdentifier();
		} else
			attributes= new HashMap(5);