Search in sources :

Example 1 with SpanStrategies

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

the class SpanStrategiesTest method spanWithUnrecognizedCssToUnsupported.

@Test
public void spanWithUnrecognizedCssToUnsupported() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.BOLD), Collections.<SpanHtmlElementStrategy>emptyList());
    assertTrue(strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "font-weight:unknown", null)) instanceof UnsupportedSpanStrategy);
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SpanStrategies(org.eclipse.mylyn.wikitext.html.internal.SpanStrategies) UnsupportedSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.UnsupportedSpanStrategy) Test(org.junit.Test)

Example 2 with SpanStrategies

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

the class SpanStrategiesTest method spanWithTextDecorationUnderlineToUnderlined.

@Test
public void spanWithTextDecorationUnderlineToUnderlined() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.UNDERLINED), Collections.<SpanHtmlElementStrategy>emptyList());
    SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "text-decoration:  underline;", null));
    assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
    assertEquals(SpanType.UNDERLINED, ((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 3 with SpanStrategies

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

the class SpanStrategiesTest method alternatives.

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

Example 4 with SpanStrategies

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

the class SpanStrategiesTest method spanWithFontWeightToBold.

@Test
public void spanWithFontWeightToBold() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.BOLD), Collections.<SpanHtmlElementStrategy>emptyList());
    SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "font-weight:  bold", null));
    assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
    assertEquals(SpanType.BOLD, ((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 5 with SpanStrategies

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

the class SpanStrategiesTest method spanWithFontWeightToStrong.

@Test
public void spanWithFontWeightToStrong() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.STRONG), Collections.<SpanHtmlElementStrategy>emptyList());
    SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "font-weight:  bold", null));
    assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
    assertEquals(SpanType.STRONG, ((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)

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