use of org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal 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;
}
use of org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal in project che by eclipse.
the class CompletionProposalCollector method createFieldProposal.
private IJavaCompletionProposal createFieldProposal(CompletionProposal proposal) {
String completion = String.valueOf(proposal.getCompletion());
int start = proposal.getReplaceStart();
int length = getLength(proposal);
StyledString label = fLabelProvider.createStyledLabel(proposal);
Image image = getImage(fLabelProvider.createFieldImageDescriptor(proposal));
int relevance = computeRelevance(proposal);
JavaCompletionProposal javaProposal = new JavaCompletionProposal(completion, start, length, image, label, relevance, getContext().isInJavadoc(), getInvocationContext());
if (fJavaProject != null)
javaProposal.setProposalInfo(new FieldProposalInfo(fJavaProject, proposal));
javaProposal.setTriggerCharacters(VAR_TRIGGER);
return javaProposal;
}
use of org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal in project che by eclipse.
the class CompletionProposalCollector method createLabelProposal.
private IJavaCompletionProposal createLabelProposal(CompletionProposal proposal) {
String completion = String.valueOf(proposal.getCompletion());
int start = proposal.getReplaceStart();
int length = getLength(proposal);
StyledString label = fLabelProvider.createSimpleLabel(proposal);
int relevance = computeRelevance(proposal);
return new JavaCompletionProposal(completion, start, length, null, label, relevance);
}
use of org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal in project che by eclipse.
the class CompletionProposalCollector method createKeywordProposal.
private IJavaCompletionProposal createKeywordProposal(CompletionProposal proposal) {
String completion = String.valueOf(proposal.getCompletion());
int start = proposal.getReplaceStart();
int length = getLength(proposal);
StyledString label = fLabelProvider.createSimpleLabel(proposal);
int relevance = computeRelevance(proposal);
return new JavaCompletionProposal(completion, start, length, null, label, relevance);
}
use of org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal in project che by eclipse.
the class CompletionProposalCollector method createAnnotationAttributeReferenceProposal.
private IJavaCompletionProposal createAnnotationAttributeReferenceProposal(CompletionProposal proposal) {
StyledString displayString = fLabelProvider.createLabelWithTypeAndDeclaration(proposal);
ImageDescriptor descriptor = fLabelProvider.createMethodImageDescriptor(proposal);
String completion = String.valueOf(proposal.getCompletion());
JavaCompletionProposal javaProposal = new JavaCompletionProposal(completion, proposal.getReplaceStart(), getLength(proposal), getImage(descriptor), displayString, computeRelevance(proposal));
if (fJavaProject != null)
javaProposal.setProposalInfo(new AnnotationAtttributeProposalInfo(fJavaProject, proposal));
return javaProposal;
}
Aggregations