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/JavaSearchPage.java
fLimitTo[IMPLEMENTORS].setEnabled((values.searchFor == TYPE));
		fLimitTo[DECLARATIONS].setEnabled((values.searchFor != PACKAGE));
		fLimitTo[ALL_OCCURRENCES].setEnabled((values.searchFor != PACKAGE));				
		fInitialPattern= values.pattern;
		fPattern.setText(fInitialPattern);
		fJavaElement= values.javaElement;
		if (values.workingSet != null)
			getContainer().setSelectedWorkingSet(values.workingSet);
		else
			getContainer().setSelectedScope(values.scope);
	}
	private void handleSearchForSelected(boolean state) {
		boolean implState= fLimitTo[IMPLEMENTORS].getSelection();
		if (!state && implState) {
			fLimitTo[IMPLEMENTORS].setSelection(false);
			fLimitTo[REFERENCES].setSelection(true);
		}
		fLimitTo[IMPLEMENTORS].setEnabled(state);
		fJavaElement= null;
	}
		
	private Control createSearchFor(Composite parent) {
		Group result= new Group(parent, SWT.NONE);
		result.setText(SearchMessages.getString("SearchPage.searchFor.label")); 
		GridLayout layout= new GridLayout();
		layout.numColumns= 3;
		result.setLayout(layout);
		fSearchFor= new Button[fSearchForText.length];
		for (int i= 0; i < fSearchForText.length; i++) {
			Button button= new Button(result, SWT.RADIO);