Search in sources :

Example 6 with SpanStrategy

use of org.eclipse.mylyn.wikitext.html.internal.SpanStrategy in project mylyn.docs by eclipse.

the class FontElementStrategyTest method assertHtmlFromSpanWithCss.

void assertHtmlFromSpanWithCss(String expectedHtml, String spanCssStyle) {
    StringWriter out = new StringWriter();
    HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
    SpanStrategy spanStrategy = strategy.spanStrategy();
    spanStrategy.beginSpan(builder, SpanType.SPAN, new Attributes(null, null, spanCssStyle, null));
    builder.characters("test");
    spanStrategy.endSpan(builder);
    assertEquals(expectedHtml, out.toString());
}
Also used : SpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SpanStrategy) StringWriter(java.io.StringWriter) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HtmlDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)

Aggregations

SpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SpanStrategy)6 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)6 Test (org.junit.Test)5 SpanStrategies (org.eclipse.mylyn.wikitext.html.internal.SpanStrategies)4 SubstitutionSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy)4 SubstitutionWithoutCssSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy)4 SupportedSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SupportedSpanStrategy)4 UnsupportedSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.UnsupportedSpanStrategy)4 StringWriter (java.io.StringWriter)1 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)1 HtmlDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)1 BeginSpanEvent (org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent)1 CharactersEvent (org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent)1 EndSpanEvent (org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent)1