Search in sources :

Example 1 with JavadocBrowserInformationControlInput

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

the class AbstractJavaCompletionProposal method getAdditionalProposalInfo.

/*
	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension5#getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor)
	 */
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
    if (getProposalInfo() != null) {
        String info = getProposalInfo().getInfo(monitor);
        if (info != null && info.length() > 0) {
            StringBuffer buffer = new StringBuffer();
            HTMLPrinter.insertPageProlog(buffer, 0, getCSSStyles());
            buffer.append(info);
            IJavaElement element = null;
            try {
                element = getProposalInfo().getJavaElement();
                if (element instanceof IMember) {
                //TODO
                //						String base= JavaDocLocations.getBaseURL(element, ((IMember)element).isBinary());
                //						if (base != null) {
                //							int endHeadIdx= buffer.indexOf("</head>"); //$NON-NLS-1$
                //							buffer.insert(endHeadIdx, "\n<base href='" + base + "'>\n"); //$NON-NLS-1$ //$NON-NLS-2$
                //						}
                }
            } catch (JavaModelException e) {
                JavaPlugin.log(e);
            }
            HTMLPrinter.addPageEpilog(buffer);
            info = buffer.toString();
            return new JavadocBrowserInformationControlInput(info);
        }
    }
    return null;
}
Also used : IJavaElement(org.eclipse.jdt.core.IJavaElement) JavaModelException(org.eclipse.jdt.core.JavaModelException) JavadocBrowserInformationControlInput(org.eclipse.jdt.internal.ui.text.java.hover.JavadocBrowserInformationControlInput) StyledString(org.eclipse.jface.viewers.StyledString) IMember(org.eclipse.jdt.core.IMember)

Aggregations

IJavaElement (org.eclipse.jdt.core.IJavaElement)1 IMember (org.eclipse.jdt.core.IMember)1 JavaModelException (org.eclipse.jdt.core.JavaModelException)1 JavadocBrowserInformationControlInput (org.eclipse.jdt.internal.ui.text.java.hover.JavadocBrowserInformationControlInput)1 StyledString (org.eclipse.jface.viewers.StyledString)1