Search in sources :

Example 6 with BlockStrategies

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

the class BlockStrategiesTest method alternatives.

@Test
public void alternatives() {
    BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.PARAGRAPH));
    assertTrue(strategies.getStrategy(BlockType.CODE, new Attributes()) instanceof SubstitutionBlockStrategy);
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SubstitutionBlockStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy) BlockStrategies(org.eclipse.mylyn.wikitext.html.internal.BlockStrategies) Test(org.junit.Test)

Example 7 with BlockStrategies

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

the class BlockStrategiesTest method definitionList.

@Test
public void definitionList() {
    BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.DEFINITION_LIST));
    assertSupported(strategies, BlockType.DEFINITION_LIST);
    assertSupported(strategies, BlockType.DEFINITION_ITEM);
    assertSupported(strategies, BlockType.DEFINITION_TERM);
}
Also used : BlockStrategies(org.eclipse.mylyn.wikitext.html.internal.BlockStrategies) Test(org.junit.Test)

Example 8 with BlockStrategies

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

the class BlockStrategiesTest method table.

@Test
public void table() {
    BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.TABLE));
    assertSupported(strategies, BlockType.TABLE);
    assertSupported(strategies, BlockType.TABLE_ROW);
    assertSupported(strategies, BlockType.TABLE_CELL_HEADER);
    assertSupported(strategies, BlockType.TABLE_CELL_NORMAL);
}
Also used : BlockStrategies(org.eclipse.mylyn.wikitext.html.internal.BlockStrategies) Test(org.junit.Test)

Example 9 with BlockStrategies

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

the class BlockStrategiesTest method fallBackToNoOp.

@Test
public void fallBackToNoOp() {
    BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.PARAGRAPH));
    List<BlockType> unsupportedBlockTypes = ImmutableList.of(BlockType.TABLE, BlockType.BULLETED_LIST, BlockType.NUMERIC_LIST, BlockType.DEFINITION_LIST);
    for (BlockType blockType : unsupportedBlockTypes) {
        BlockStrategy strategy = strategies.getStrategy(blockType, new Attributes());
        assertNotNull(strategy);
        assertTrue(NoOpBlockStrategy.class.equals(strategy.getClass()));
    }
}
Also used : NoOpBlockStrategy(org.eclipse.mylyn.wikitext.html.internal.NoOpBlockStrategy) BlockType(org.eclipse.mylyn.wikitext.parser.DocumentBuilder.BlockType) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) BlockStrategies(org.eclipse.mylyn.wikitext.html.internal.BlockStrategies) UnsupportedBlockStrategy(org.eclipse.mylyn.wikitext.html.internal.UnsupportedBlockStrategy) NoOpBlockStrategy(org.eclipse.mylyn.wikitext.html.internal.NoOpBlockStrategy) BlockStrategy(org.eclipse.mylyn.wikitext.html.internal.BlockStrategy) SupportedBlockStrategy(org.eclipse.mylyn.wikitext.html.internal.SupportedBlockStrategy) SubstitutionBlockStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy) Test(org.junit.Test)

Aggregations

BlockStrategies (org.eclipse.mylyn.wikitext.html.internal.BlockStrategies)9 Test (org.junit.Test)8 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)5 SubstitutionBlockStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy)4 BlockStrategy (org.eclipse.mylyn.wikitext.html.internal.BlockStrategy)3 NoOpBlockStrategy (org.eclipse.mylyn.wikitext.html.internal.NoOpBlockStrategy)3 SupportedBlockStrategy (org.eclipse.mylyn.wikitext.html.internal.SupportedBlockStrategy)3 UnsupportedBlockStrategy (org.eclipse.mylyn.wikitext.html.internal.UnsupportedBlockStrategy)3 BlockType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.BlockType)3