Search in sources :

Example 1 with MethodProposalInfo

use of org.eclipse.jdt.internal.ui.text.java.MethodProposalInfo in project che by eclipse.

the class CompletionProposalCollector method createMethodDeclarationProposal.

private IJavaCompletionProposal createMethodDeclarationProposal(CompletionProposal proposal) {
    if (fCompilationUnit == null || fJavaProject == null)
        return null;
    String name = String.valueOf(proposal.getName());
    String[] paramTypes = Signature.getParameterTypes(String.valueOf(proposal.getSignature()));
    for (int index = 0; index < paramTypes.length; index++) paramTypes[index] = Signature.toString(paramTypes[index]);
    int start = proposal.getReplaceStart();
    int length = getLength(proposal);
    StyledString label = fLabelProvider.createOverrideMethodProposalLabel(proposal);
    JavaCompletionProposal javaProposal = new OverrideCompletionProposal(fJavaProject, fCompilationUnit, name, paramTypes, start, length, label, String.valueOf(proposal.getCompletion()));
    javaProposal.setImage(getImage(fLabelProvider.createMethodImageDescriptor(proposal)));
    javaProposal.setProposalInfo(new MethodProposalInfo(fJavaProject, proposal));
    javaProposal.setRelevance(computeRelevance(proposal));
    fSuggestedMethodNames.add(new String(name));
    return javaProposal;
}
Also used : OverrideCompletionProposal(org.eclipse.jdt.internal.ui.text.java.OverrideCompletionProposal) MethodProposalInfo(org.eclipse.jdt.internal.ui.text.java.MethodProposalInfo) StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString) JavaCompletionProposal(org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal) LazyJavaCompletionProposal(org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal)

Aggregations

JavaCompletionProposal (org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal)1 LazyJavaCompletionProposal (org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal)1 MethodProposalInfo (org.eclipse.jdt.internal.ui.text.java.MethodProposalInfo)1 OverrideCompletionProposal (org.eclipse.jdt.internal.ui.text.java.OverrideCompletionProposal)1 StyledString (org.eclipse.jface.viewers.StyledString)1