Search in sources :

Example 1 with BeginSpanEvent

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

the class MultiplexingDocumentBuilderTest method beginSpan.

@Test
public void beginSpan() {
    multiplexer.beginSpan(SpanType.DELETED, new Attributes());
    assertEvents(new BeginSpanEvent(SpanType.DELETED, new Attributes()));
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HeadingAttributes(org.eclipse.mylyn.wikitext.parser.HeadingAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) Test(org.junit.Test)

Example 2 with BeginSpanEvent

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

the class BeginSpanEventTest method equals.

@Test
public void equals() {
    assertEquality(new BeginSpanEvent(SpanType.CODE, new Attributes()), new BeginSpanEvent(SpanType.CODE, new Attributes()));
    assertInequality(new BeginSpanEvent(SpanType.CODE, new Attributes()), new BeginSpanEvent(SpanType.BOLD, new Attributes()));
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) Test(org.junit.Test)

Example 3 with BeginSpanEvent

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

the class SubstitutionWithoutCssSpanStrategyTest method test.

@Test
public void test() {
    SubstitutionWithoutCssSpanStrategy strategy = new SubstitutionWithoutCssSpanStrategy(SpanType.BOLD);
    EventDocumentBuilder builder = new EventDocumentBuilder();
    strategy.beginSpan(builder, SpanType.ITALIC, new Attributes("1", "class", "style", "lang"));
    List<DocumentBuilderEvent> events = builder.getDocumentBuilderEvents().getEvents();
    assertEquals(ImmutableList.of(new BeginSpanEvent(SpanType.BOLD, new Attributes("1", "class", null, "lang"))), events);
}
Also used : DocumentBuilderEvent(org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvent) EventDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) SubstitutionWithoutCssSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy) Test(org.junit.Test)

Example 4 with BeginSpanEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent 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 5 with BeginSpanEvent

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

the class EventDocumentBuilderTest method beginSpan.

@Test
public void beginSpan() {
    builder.beginSpan(SpanType.DELETED, new Attributes());
    assertEvents(new BeginSpanEvent(SpanType.DELETED, new Attributes()));
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HeadingAttributes(org.eclipse.mylyn.wikitext.parser.HeadingAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) 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