Java Code Examples for org.eclipse.jface.text.TextPresentation#applyTextPresentation()

The following examples show how to use org.eclipse.jface.text.TextPresentation#applyTextPresentation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InformationControl.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see IInformationControl#setInformation(String)
 */
@SuppressWarnings("deprecation")
public void setInformation(String content) {
	if (fPresenter == null) {
		fText.setText(content);
	} else {
		fPresentation.clear();
		content= fPresenter.updatePresentation(fShell.getDisplay(), content, fPresentation, Math.max(fMaxWidth, 260), fMaxHeight);
		if (content != null) {
			fText.setText(content);
			TextPresentation.applyTextPresentation(fPresentation, fText);
		} else {
			fText.setText("");  //$NON-NLS-1$
		}
	}
}
 
Example 2
Source File: GroovyEditorDocumentationDialogTray.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void refreshDocumentationText(final IFunction f) {
    if (documenationText != null && !documenationText.isDisposed() && f != null && f.getDocumentation() != null) {
        try {
            fPresentation.clear();
            final Rectangle size = documenationText.getClientArea();
            javadocHtml = fPresenter.updatePresentation(documenationText, f.getDocumentation(), fPresentation, size.width, size.height);
        } catch (final IllegalArgumentException ex) {
            // the javadoc might no longer be valid
            return;
        }
        documenationText.setText(javadocHtml);
        TextPresentation.applyTextPresentation(fPresentation, documenationText);
    }
}