|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xwiki.rendering.renderer.printer.XMLWikiPrinter org.xwiki.rendering.renderer.printer.XHTMLWikiPrinter org.xwiki.annotation.internal.renderer.AnnotationMarkersXHTMLPrinter
public class AnnotationMarkersXHTMLPrinter
XHTML Printer to handle printing annotations markers in the rendered XHTML. It is able to generate the annotation
start marker and end marker and to store information about the annotations state: which ones are being currently
rendered, which markers are opened, etc. To be used by the XHTML renderers to render annotations on the XHTML.
Note that, although this class could aggregate a XHTMLWikiPrinter, and be used to wrap the default XHTMLWikiPrinter
in a XHTML Renderer, it extends it so that it can replace. TODO: in a future improved implementation, this could
handle annotations rendering alone, just using state information from the renderer.
Field Summary |
---|
Fields inherited from class org.xwiki.rendering.renderer.printer.XMLWikiPrinter |
---|
wikiWriter, xmlWriter |
Constructor Summary | |
---|---|
AnnotationMarkersXHTMLPrinter(WikiPrinter printer)
Builds an XHTML markers annotations printer which uses the underlying wiki printer. |
Method Summary | |
---|---|
void |
beginAnnotation(Annotation annotation)
Handles the beginning of a new annotation. |
void |
closeAllAnnotationMarkers()
Helper function to handle closing all annotations. |
void |
endAnnotation(Annotation annotation)
Handles the end of an annotation. |
void |
openAllAnnotationMarkers()
Helper function to handle opening all annotations. |
void |
printXMLWithAnnotations(String text,
SortedMap<Integer,List<AnnotationEvent>> annotations)
Helper function to help render a piece of text with annotation events inside it, at the specified offsets. |
Methods inherited from class org.xwiki.rendering.renderer.printer.XHTMLWikiPrinter |
---|
printRaw, printSpace, printXML, printXMLComment, printXMLComment, printXMLElement, printXMLElement, printXMLElement, printXMLEndCData, printXMLEndElement, printXMLStartCData, printXMLStartElement, printXMLStartElement, printXMLStartElement, printXMLStartElement |
Methods inherited from class org.xwiki.rendering.renderer.printer.XMLWikiPrinter |
---|
getXMLWriter, printEntity, setWikiPrinter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationMarkersXHTMLPrinter(WikiPrinter printer)
printer
- the wiki printer used by this XHTML printerMethod Detail |
---|
public void beginAnnotation(Annotation annotation)
annotation
- the annotation that beginspublic void endAnnotation(Annotation annotation)
annotation
- the annotation that endspublic void closeAllAnnotationMarkers()
public void openAllAnnotationMarkers()
public void printXMLWithAnnotations(String text, SortedMap<Integer,List<AnnotationEvent>> annotations)
text
- the text to renderannotations
- the map of indexes and annotation events to render in this text
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |