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/ui/org/eclipse/jdt/internal/ui/text/java/JavaTypeCompletionProposal.java
if (packageName.length() == 0)
			return typeName;
		return packageName + '.' + typeName;
	}
	public JavaTypeCompletionProposal(String replacementString, ICompilationUnit cu, int replacementOffset, int replacementLength, Image image, String displayString, int relevance) {
		this(replacementString, cu, replacementOffset, replacementLength, image, displayString, relevance, null, null);
	}
	public JavaTypeCompletionProposal(String replacementString, ICompilationUnit cu, int replacementOffset, int replacementLength, Image image, String displayString, int relevance,
		String typeName, String packageName)
	{
		this(replacementString, cu, replacementOffset, replacementLength, image, displayString, relevance, typeName, packageName, null);
	}
	
	public JavaTypeCompletionProposal(String replacementString, ICompilationUnit cu, int replacementOffset, int replacementLength, Image image, String displayString, int relevance,
		String typeName, String packageName, ITextViewer viewer)
	{
		super(replacementString, replacementOffset, replacementLength, image, displayString, relevance, viewer);
		fCompilationUnit= cu;
		fUnqualifiedTypeName= unqualify(typeName);
		fFullyQualifiedTypeName= qualify(typeName, packageName);
	}
	
	protected boolean updateReplacementString(IDocument document, char trigger, int offset, ImportsStructure impStructure) throws CoreException, BadLocationException {
		
		if (impStructure != null && fFullyQualifiedTypeName != null && getReplacementString().startsWith(fFullyQualifiedTypeName) && !getReplacementString().endsWith(";")) { 
			IType[] types= impStructure.getCompilationUnit().getTypes();
			if (types.length > 0 && types[0].getSourceRange().getOffset() <= offset) {
				
				setReplacementString(impStructure.addImport(getReplacementString()));