Search in sources :

Example 1 with EndSpanEvent

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

the class EventDocumentBuilderTest method endSpan.

@Test
public void endSpan() {
    builder.endSpan();
    assertEvents(new EndSpanEvent());
}
Also used : EndSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent) Test(org.junit.Test)

Example 2 with EndSpanEvent

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

the class CompositeSpanStrategyTest method test.

@Test
public void test() {
    CompositeSpanStrategy strategy = new CompositeSpanStrategy(Lists.<SpanStrategy>newArrayList(new SubstitutionWithoutCssSpanStrategy(SpanType.BOLD), new SubstitutionWithoutCssSpanStrategy(SpanType.ITALIC)));
    EventDocumentBuilder builder = new EventDocumentBuilder();
    strategy.beginSpan(builder, SpanType.DELETED, new Attributes());
    strategy.endSpan(builder);
    DocumentBuilderEvents events = builder.getDocumentBuilderEvents();
    assertEquals(ImmutableList.of(new BeginSpanEvent(SpanType.BOLD, new Attributes()), new BeginSpanEvent(SpanType.ITALIC, new Attributes()), new EndSpanEvent(), new EndSpanEvent()), events.getEvents());
}
Also used : DocumentBuilderEvents(org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents) EventDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder) CompositeSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.CompositeSpanStrategy) 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) SubstitutionWithoutCssSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy) Test(org.junit.Test)

Example 3 with EndSpanEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent 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)

Example 4 with EndSpanEvent

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

the class MultiplexingDocumentBuilderTest method endSpan.

@Test
public void endSpan() {
    multiplexer.endSpan();
    assertEvents(new EndSpanEvent());
}
Also used : EndSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent) Test(org.junit.Test)

Aggregations

EndSpanEvent (org.eclipse.mylyn.wikitext.parser.builder.event.EndSpanEvent)4 Test (org.junit.Test)4 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)2 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)2 BeginSpanEvent (org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent)2 CompositeSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.CompositeSpanStrategy)1 SpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SpanStrategy)1 SubstitutionWithoutCssSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy)1 CharactersEvent (org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent)1 DocumentBuilderEvents (org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents)1