本文整理汇总了Java中org.eclipse.jface.internal.text.html.HTMLPrinter.addPageEpilog方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLPrinter.addPageEpilog方法的具体用法?Java HTMLPrinter.addPageEpilog怎么用?Java HTMLPrinter.addPageEpilog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.internal.text.html.HTMLPrinter
的用法示例。
在下文中一共展示了HTMLPrinter.addPageEpilog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatMultipleMessages
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
/**
* Hook method to formats the given messages.
* <p>
* Subclasses can change this to create a different format like HTML.
* </p>
*
* @param messages
* the messages to format (element type: {@link String})
* @return the formatted message
*/
@SuppressWarnings("rawtypes")
protected String formatMultipleMessages(List messages)
{
StringBuffer buffer = new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer,
HTMLPrinter.convertToHTMLContent(Messages.CommonAnnotationHover_multipleMarkersMessage));
HTMLPrinter.startBulletList(buffer);
Iterator e = messages.iterator();
while (e.hasNext())
{
HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String) e.next()));
}
HTMLPrinter.endBulletList(buffer);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例2: 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();
}
示例3: formatMultipleMessages
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
@Override
protected String formatMultipleMessages(@SuppressWarnings("rawtypes") List messages) {
StringBuffer buffer = new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter
.convertToHTMLContent(JavaUIMessages.JavaAnnotationHover_multipleMarkersAtThisLine));
HTMLPrinter.startBulletList(buffer);
Iterator<?> e = messages.iterator();
while (e.hasNext())
HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String) e.next()));
HTMLPrinter.endBulletList(buffer);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例4: 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);
}
示例5: 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;
}
示例6: formatSingleMessage
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
/**
* Hook method to format the given single message.
* <p>
* Subclasses can change this to create a different format like HTML.
* </p>
*
* @param message
* the message to format
* @return the formatted message
*/
protected String formatSingleMessage(String message)
{
StringBuffer buffer = new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例7: formatSingleMessage
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
@Override
protected String formatSingleMessage(String message) {
StringBuffer buffer= new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例8: formatMultipleMessages
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
@Override
protected String formatMultipleMessages(List messages) {
StringBuffer buffer= new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(JavaUIMessages.JavaAnnotationHover_multipleMarkersAtThisLine));
HTMLPrinter.startBulletList(buffer);
Iterator<?> e= messages.iterator();
while (e.hasNext())
HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String) e.next()));
HTMLPrinter.endBulletList(buffer);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例9: 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
示例10: formatSingleMessage
import org.eclipse.jface.internal.text.html.HTMLPrinter; //导入方法依赖的package包/类
@Override
protected String formatSingleMessage(String message) {
StringBuffer buffer = new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
示例11: 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
示例12: 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);
}
示例13: 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;
}
示例14: 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);
}
示例15: 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();
}