Search in sources :

Example 1 with ICompletionProposalExtension5

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;
}
Also used : ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) ICompletionProposalExtension5(org.eclipse.jface.text.contentassist.ICompletionProposalExtension5)

Example 2 with ICompletionProposalExtension5

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;
}
Also used : ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) ICompletionProposalExtension5(org.eclipse.jface.text.contentassist.ICompletionProposalExtension5)

Example 3 with ICompletionProposalExtension5

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);
        }
    }
}
Also used : IFile(org.eclipse.core.resources.IFile) ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) ICompletionProposalExtension5(org.eclipse.jface.text.contentassist.ICompletionProposalExtension5) StructuredTextEditor(org.eclipse.wst.sse.ui.StructuredTextEditor) StructuredTextViewer(org.eclipse.wst.sse.ui.internal.StructuredTextViewer)

Aggregations

ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)3 ICompletionProposalExtension5 (org.eclipse.jface.text.contentassist.ICompletionProposalExtension5)3 IFile (org.eclipse.core.resources.IFile)1 StructuredTextEditor (org.eclipse.wst.sse.ui.StructuredTextEditor)1 StructuredTextViewer (org.eclipse.wst.sse.ui.internal.StructuredTextViewer)1