Search in sources :

Example 6 with SpanStrategies

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

the class SpanStrategiesTest method spanWithTextDecorationLinethroughToDeleted.

@Test
public void spanWithTextDecorationLinethroughToDeleted() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.DELETED), Collections.<SpanHtmlElementStrategy>emptyList());
    SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "text-decoration:  line-through;", null));
    assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
    assertEquals(SpanType.DELETED, ((SubstitutionWithoutCssSpanStrategy) strategy).getType());
}
Also used : SubstitutionWithoutCssSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy) SupportedSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SupportedSpanStrategy) UnsupportedSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.UnsupportedSpanStrategy) SubstitutionSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy) SpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SpanStrategy) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SpanStrategies(org.eclipse.mylyn.wikitext.html.internal.SpanStrategies) SubstitutionWithoutCssSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy) Test(org.junit.Test)

Example 7 with SpanStrategies

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

the class SpanStrategiesTest method createNonEmpty.

@Test
public void createNonEmpty() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.BOLD, SpanType.CODE), Collections.<SpanHtmlElementStrategy>emptyList());
    assertSupported(strategies, SpanType.BOLD);
    assertSupported(strategies, SpanType.CODE);
    for (SpanType spanType : SpanType.values()) {
        assertNotNull(strategies.getStrategy(spanType, new Attributes()));
    }
}
Also used : SpanType(org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SpanStrategies(org.eclipse.mylyn.wikitext.html.internal.SpanStrategies) Test(org.junit.Test)

Example 8 with SpanStrategies

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

the class SpanStrategiesTest method createEmpty.

@Test
public void createEmpty() {
    SpanStrategies strategies = new SpanStrategies(Sets.<SpanType>newHashSet(), Collections.<SpanHtmlElementStrategy>emptyList());
    assertNotNull(strategies.getStrategy(SpanType.BOLD, new Attributes()));
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SpanStrategies(org.eclipse.mylyn.wikitext.html.internal.SpanStrategies) Test(org.junit.Test)

Aggregations

SpanStrategies (org.eclipse.mylyn.wikitext.html.internal.SpanStrategies)8 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)8 Test (org.junit.Test)8 SubstitutionSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy)5 UnsupportedSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.UnsupportedSpanStrategy)5 SpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SpanStrategy)4 SubstitutionWithoutCssSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy)4 SupportedSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SupportedSpanStrategy)4 SpanType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType)1