Bug 13189 Refactoring - deleting fields - context menu is overriden by message dialog
20020409-I on Linux-Motif and w2k: 1. Setup JUnit 2. Enable option 'Code Generator->Remove prefix from field names' 3. Open TestCase.java 4. In the outliner, right click on 'fName'. 5. Observe: No context menu is shown, instead, it asks me right away if I want to delete the getter/setter as well.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/DeleteSourceReferencesAction.java
delete(file, getNonFields(refs));
		delete(getFields(refs));
	}
	private static void delete(IFile file, ISourceReference[] nonFields) throws CoreException{
		TextBuffer tb= TextBuffer.acquire(file);
		try{
			TextBufferEditor tbe= new TextBufferEditor(tb);
			for (int i= 0; i < nonFields.length; i++) {
				Assert.isTrue(! (nonFields[i] instanceof IField));
				tbe.add(createDeleteEdit(nonFields[i]));
			}
			if (! tbe.canPerformEdits())
				return; 
			tbe.performEdits(new NullProgressMonitor());	
			TextBuffer.commitChanges(tb, false, new NullProgressMonitor());
		} finally{
			if (tb != null)
				TextBuffer.release(tb);
		}	
	}
	
	private static void delete(IField[] fields) throws JavaModelException{
		for (int i= 0; i < fields.length; i++) {
			fields[i].delete(false, new NullProgressMonitor());
		}
	}
			
	private static TextEdit createDeleteEdit(ISourceReference ref) throws JavaModelException{
		ICompilationUnit cu= SourceReferenceUtil.getCompilationUnit(ref);
		cu.reconcile();