Search in sources :

Example 6 with BeginSpanEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent in project mylyn.docs by eclipse.

the class FontElementStrategyTest method spanStrategyBuildsNonHtml.

@Test
public void spanStrategyBuildsNonHtml() {
    EventDocumentBuilder builder = new EventDocumentBuilder();
    SpanStrategy spanStrategy = strategy.spanStrategy();
    spanStrategy.beginSpan(builder, SpanType.SPAN, new Attributes(null, null, "color: red", null));
    builder.characters("test");
    spanStrategy.endSpan(builder);
    assertEquals(Arrays.asList(new BeginSpanEvent(SpanType.SPAN, new Attributes(null, null, "color: red", null)), new CharactersEvent("test"), new EndSpanEvent()), builder.getDocumentBuilderEvents().getEvents());
}
Also used : SpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SpanStrategy) CharactersEvent(org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent) EventDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) EndSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent) Test(org.junit.Test)

Aggregations

Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)6 BeginSpanEvent (org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent)6 Test (org.junit.Test)6 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)3 SubstitutionWithoutCssSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy)2 HeadingAttributes (org.eclipse.mylyn.wikitext.parser.HeadingAttributes)2 ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)2 LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)2 EndSpanEvent (org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent)2 CompositeSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.CompositeSpanStrategy)1 SpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SpanStrategy)1 CharactersEvent (org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent)1 DocumentBuilderEvent (org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvent)1 DocumentBuilderEvents (org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents)1