use of org.eclipse.jface.text.contentassist.ICompletionProposalExtension5 in project webtools.sourceediting by eclipse.
the class JSPCompletionProposal method getAdditionalProposalInfo.
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension5#getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor)
*/
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
Object additionalInfo = super.getAdditionalProposalInfo();
ICompletionProposal javaProposal = getJavaCompletionProposal();
if (javaProposal != null) {
if (javaProposal instanceof ICompletionProposalExtension5)
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=260951
additionalInfo = ((ICompletionProposalExtension5) javaProposal).getAdditionalProposalInfo(monitor);
else
additionalInfo = javaProposal.getAdditionalProposalInfo();
}
return additionalInfo;
}
use of org.eclipse.jface.text.contentassist.ICompletionProposalExtension5 in project webtools.sourceediting by eclipse.
the class JSDTCompletionProposal method getAdditionalProposalInfo.
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
Object additionalInfo = super.getAdditionalProposalInfo(monitor);
ICompletionProposal javaProposal = getJavaCompletionProposal();
if ((javaProposal != null) && (javaProposal instanceof ICompletionProposalExtension5)) {
additionalInfo = ((ICompletionProposalExtension5) javaProposal).getAdditionalProposalInfo(monitor);
}
return additionalInfo;
}
use of org.eclipse.jface.text.contentassist.ICompletionProposalExtension5 in project webtools.sourceediting by eclipse.
the class TestCSSContentAssistComputers method testAdditionalProposalInfo.
public void testAdditionalProposalInfo() throws Exception {
IFile file = getFile("test4.css");
StructuredTextEditor editor = getEditor(file);
StructuredTextViewer viewer = editor.getTextViewer();
int offset = viewer.getDocument().getLineLength(7) + 23;
ICompletionProposal[][] pages = getProposals(viewer, offset, 4);
assertTrue("Not enough pages", pages.length > 0);
ICompletionProposal[] proposals = pages[0];
for (int i = 0; i < proposals.length; i++) {
if (proposals[i] instanceof ICompletionProposalExtension5) {
Object obj = ((ICompletionProposalExtension5) proposals[i]).getAdditionalProposalInfo(null);
assertTrue("Additional info must be of type ProposalInfo", obj instanceof ProposalInfo);
ProposalInfo info = (ProposalInfo) obj;
assertNotNull("CSSMMNode for Proposal Info should not be null", info);
}
}
}
Aggregations