Bug 84998 [api] Make ResultCollector API
Eclipse 3.0.1 In our application we provide code assist to our own Java editor. In order to be consistent with the JDT Java editor we need to provide the same look and feel for code assist (icons, ordering, display string, etc...). Currently the only way we can get that to work is using the internal class ResultCollector. Since ResultCollector is basically an implementation of ICompletionRequestor, would it be possible to make it API or at least provide the functionality to people implementing code assist for Java-like editors?
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeCompletionTest.java
buf.append("        }\n");
		buf.append("    }\n");
		buf.append("}\n");
		assertEqualString(doc.get(), buf.toString());
	}
	public void testSetterCompletion1() throws Exception {
		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
		IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null);
		StringBuffer buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("\n");
		buf.append("import java.io.BufferedWriter;\n");
		buf.append("\n");
		buf.append("public class A {\n");
		buf.append("    private BufferedWriter writer;\n");
		buf.append("    se//here\n");
		buf.append("}\n");
		String contents= buf.toString();
		ICompilationUnit cu= pack1.createCompilationUnit("A.java", contents, false, null);
		IEditorPart part= EditorUtility.openInEditor(cu);
		try {
			String str= "//here";
			int offset= contents.indexOf(str);
			ResultCollector collector= new ResultCollector();
			collector.reset(offset, cu.getJavaProject(), cu);
			collector.setViewer(null);
			collector.setReplacementLength(0);
			collector.setPreventEating(true);
			codeComplete(cu, offset, collector);
			JavaCompletionProposal[] proposals= collector.getResults();