use of org.eclipse.che.jface.text.contentassist.IContextInformation in project che by eclipse.
the class JavaCompletionProposalComputer method addContextInformations.
private List<IContextInformation> addContextInformations(JavaContentAssistInvocationContext context, int offset) {
List<ICompletionProposal> proposals = internalComputeCompletionProposals(offset, context);
List<IContextInformation> result = new ArrayList<IContextInformation>(proposals.size());
List<IContextInformation> anonymousResult = new ArrayList<IContextInformation>(proposals.size());
for (Iterator<ICompletionProposal> it = proposals.iterator(); it.hasNext(); ) {
ICompletionProposal proposal = it.next();
IContextInformation contextInformation = proposal.getContextInformation();
if (contextInformation != null) {
ContextInformationWrapper wrapper = new ContextInformationWrapper(contextInformation);
wrapper.setContextInformationPosition(offset);
if (proposal instanceof AnonymousTypeCompletionProposal)
anonymousResult.add(wrapper);
else
result.add(wrapper);
}
}
if (result.size() == 0)
return anonymousResult;
return result;
}
use of org.eclipse.che.jface.text.contentassist.IContextInformation in project che by eclipse.
the class JavaCompletionProposalComputer method computeContextInformation.
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.jface.text
* .contentassist.TextContentAssistInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
if (context instanceof JavaContentAssistInvocationContext) {
JavaContentAssistInvocationContext javaContext = (JavaContentAssistInvocationContext) context;
int contextInformationPosition = guessContextInformationPosition(javaContext);
List<IContextInformation> result = addContextInformations(javaContext, contextInformationPosition);
return result;
}
return Collections.emptyList();
}
use of org.eclipse.che.jface.text.contentassist.IContextInformation in project che by eclipse.
the class ProposalContextInformation method equals.
/*
* @see IContextInformation#equals
*/
@Override
public boolean equals(Object object) {
if (object instanceof IContextInformation) {
IContextInformation contextInformation = (IContextInformation) object;
boolean equals = getInformationDisplayString().equalsIgnoreCase(contextInformation.getInformationDisplayString());
if (getContextDisplayString() != null)
equals = equals && getContextDisplayString().equalsIgnoreCase(contextInformation.getContextDisplayString());
return equals;
}
return false;
}
Aggregations