本文整理汇总了Java中org.eclipse.jface.internal.text.html.HTMLPrinter.insertPageProlog方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLPrinter.insertPageProlog方法的具体用法?Java HTMLPrinter.insertPageProlog怎么用?Java HTMLPrinter.insertPageProlog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.internal.text.html.HTMLPrinter
的用法示例。
在下文中一共展示了HTMLPrinter.insertPageProlog方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toHtml
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
private String toHtml(String header, String string, String errorString, boolean addPreFormatted) {
StringBuffer buffer= new StringBuffer();
HTMLPrinter.addSmallHeader(buffer, header);
if (string != null) {
if (addPreFormatted) {
HTMLPrinter.addParagraph(buffer, ""); //$NON-NLS-1$
HTMLPrinter.addPreFormatted(buffer, HTMLPrinter.convertToHTMLContent(string));
} else {
HTMLPrinter.addParagraph(buffer, string);
}
if (errorString != null) {
HTMLPrinter.addParagraph(buffer, errorString);
}
} else {
HTMLPrinter.addParagraph(buffer, JavaHoverMessages.NLSStringHover_NLSStringHover_missingKeyWarning);
}
HTMLPrinter.insertPageProlog(buffer, 0);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例2: endPage
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
public static void endPage(StringBuffer buffer, ITextViewer textViewer) {
ITheme theme = null;
if (textViewer != null) {
TMPresentationReconciler reconciler = getTMPresentationReconciler(textViewer);
if (reconciler != null) {
theme = (ITheme) reconciler.getTokenProvider();
}
if (theme == null) {
theme = TMUIPlugin.getThemeManager().getDefaultTheme();
}
}
HTMLPrinter.insertPageProlog(buffer, 0, colorInfoForeground, colorInfoBackround,
HTMLTypeScriptPrinter.getStyleSheet() + (theme != null ? theme.toCSSStyleSheet() : ""));
HTMLPrinter.addPageEpilog(buffer);
}
示例3: getHoverInfo
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
protected XtextBrowserInformationControlInput getHoverInfo(EObject element, IRegion hoverRegion,
XtextBrowserInformationControlInput previous) {
String html = getHoverInfoAsHtml(element);
if (html != null) {
StringBuffer buffer = new StringBuffer(html);
HTMLPrinter.insertPageProlog(buffer, 0, getStyleSheet());
HTMLPrinter.addPageEpilog(buffer);
html = buffer.toString();
XtextBrowserInformationControlInput browserInput = new XtextBrowserInformationControlInput(previous, element, html, labelProvider);
return browserInput;
}
return null;
}
示例4: getAdditionalProposalInfo
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
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) {
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(null, element, info, 0);
}
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:AbstractJavaCompletionProposal.java
示例5: refresh
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
/**
* Refreshes the view.
*
* @since 3.3
*/
private void refresh() {
IJavaElement input= getInput();
if (input == null) {
StringBuffer buffer= new StringBuffer(""); //$NON-NLS-1$
HTMLPrinter.insertPageProlog(buffer, 0, null, fBackgroundColorRGB, fgStyleSheet);
doSetInput(buffer.toString());
} else {
doSetInput(computeInput(input));
}
}
示例6: getAdditionalProposalInfo
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
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) {
String base= JavaDocLocations.getBaseURL((IMember) element);
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(null, element, info, 0);
}
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:32,代码来源:AbstractJavaCompletionProposal.java
示例7: endPage
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
public static void endPage(StringBuffer buffer) {
HTMLPrinter
.insertPageProlog(buffer, 0, HTMLJSONPrinter.getStyleSheet());
HTMLPrinter.addPageEpilog(buffer);
}
示例8: getHoverInfo
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
/**
* Computes the hover info and returns a {@link DocumentationBrowserInformationControlInput} for it.
*
* @param element
* the resolved element
* @param useHTMLTags
* @param previousInput
* the previous input, or <code>null</code>
* @param editorPart
* (can be <code>null</code>)
* @param hoverRegion
* @return the HTML hover info for the given element(s) or <code>null</code> if no information is available
*/
@SuppressWarnings("unused")
protected DocumentationBrowserInformationControlInput getHoverInfo(Object element, boolean useHTMLTags,
DocumentationBrowserInformationControlInput previousInput, IEditorPart editorPart, IRegion hoverRegion)
{
if (element == null)
{
return null;
}
StringBuffer buffer = new StringBuffer();
String base = null;
int leadingImageWidth = 0;
setHeader(getHeader(element, editorPart, hoverRegion), buffer, useHTMLTags);
setDocumentation(getDocumentation(element, editorPart, hoverRegion), buffer, useHTMLTags);
if (buffer.length() > 0)
{
if (useHTMLTags)
{
Color borderColor = getBorderColor();
Color bgColor = getBackgroundColor();
Color fgColor = getForegroundColor();
String borderColorHex = (borderColor != null) ? getHexColor(borderColor.getRGB())
: DEFAULT_BORDER_COLOR;
RGB bgRGB = (bgColor != null) ? bgColor.getRGB() : null;
RGB fgRGB = (fgColor != null) ? fgColor.getRGB() : null;
// We need to set the border color before we call insertPageProlog on the style-sheet
String styleSheet = getStyleSheet();
styleSheet = styleSheet.replaceAll(BORDER_COLOR_CSS_TEXT, borderColorHex);
HTMLPrinter.insertPageProlog(buffer, 0, fgRGB, bgRGB, styleSheet);
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$
}
HTMLPrinter.addPageEpilog(buffer);
}
return new DocumentationBrowserInformationControlInput(previousInput, element, buffer.toString(),
leadingImageWidth, hoverRegion);
}
return null;
}
示例9: endPage
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
/**
*
* @param buffer
*/
public static void endPage(StringBuffer buffer) {
HTMLPrinter.insertPageProlog(buffer, 0,
HTMLWebResourcesPrinter.getStyleSheet());
HTMLPrinter.addPageEpilog(buffer);
}
示例10: getInputForNull
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
private String getInputForNull() {
StringBuffer buffer= new StringBuffer();
HTMLPrinter.insertPageProlog(buffer, 0, null, fBackgroundColorRGB, fgStyleSheet);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}