1 11 package org.eclipse.jdt.internal.ui.text; 12 13 import java.util.Iterator ; 14 import java.util.List ; 15 16 import org.eclipse.jface.internal.text.html.HTMLPrinter; 17 18 import org.eclipse.jface.text.source.DefaultAnnotationHover; 19 20 import org.eclipse.jdt.internal.ui.JavaUIMessages; 21 22 28 public class HTMLAnnotationHover extends DefaultAnnotationHover { 29 30 33 protected String formatSingleMessage(String message) { 34 StringBuffer buffer= new StringBuffer (); 35 HTMLPrinter.addPageProlog(buffer); 36 HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message)); 37 HTMLPrinter.addPageEpilog(buffer); 38 return buffer.toString(); 39 } 40 41 44 protected String formatMultipleMessages(List messages) { 45 StringBuffer buffer= new StringBuffer (); 46 HTMLPrinter.addPageProlog(buffer); 47 HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(JavaUIMessages.JavaAnnotationHover_multipleMarkersAtThisLine)); 48 49 HTMLPrinter.startBulletList(buffer); 50 Iterator e= messages.iterator(); 51 while (e.hasNext()) 52 HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String ) e.next())); 53 HTMLPrinter.endBulletList(buffer); 54 55 HTMLPrinter.addPageEpilog(buffer); 56 return buffer.toString(); 57 } 58 } 59 | Popular Tags |