本文整理匯總了Java中org.eclipse.jface.text.TextPresentation.applyTextPresentation方法的典型用法代碼示例。如果您正苦於以下問題:Java TextPresentation.applyTextPresentation方法的具體用法?Java TextPresentation.applyTextPresentation怎麽用?Java TextPresentation.applyTextPresentation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.text.TextPresentation
的用法示例。
在下文中一共展示了TextPresentation.applyTextPresentation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setInformation
import org.eclipse.jface.text.TextPresentation; //導入方法依賴的package包/類
/**
* @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$
}
}
}
示例2: doSetInput
import org.eclipse.jface.text.TextPresentation; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*
* @param input a String containing the HTML to be showin in the view
*/
@Override
protected void doSetInput(Object input) {
String javadocHtml= (String)input;
fOriginalInput= javadocHtml;
if (fInputSelectionProvider != null) {
IJavaElement inputElement= getInput();
StructuredSelection selection= inputElement == null ? StructuredSelection.EMPTY : new StructuredSelection(inputElement);
fInputSelectionProvider.setSelection(selection);
}
if (fIsUsingBrowserWidget) {
if (javadocHtml != null && javadocHtml.length() > 0) {
boolean RTL= (getSite().getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
if (RTL) {
StringBuffer buffer= new StringBuffer(javadocHtml);
HTMLPrinter.insertStyles(buffer, new String[] { "direction:rtl" } ); //$NON-NLS-1$
javadocHtml= buffer.toString();
}
}
fBrowser.setText(javadocHtml);
} else {
fPresentation.clear();
Rectangle size= fText.getClientArea();
try {
javadocHtml= fPresenter.updatePresentation(fText, javadocHtml, fPresentation, size.width, size.height);
} catch (IllegalArgumentException ex) {
// the javadoc might no longer be valid
return;
}
fText.setText(javadocHtml);
TextPresentation.applyTextPresentation(fPresentation, fText);
}
}