Search in sources :

Example 1 with IdGenerationStrategy

use of org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy in project mylyn.docs by eclipse.

the class AsciiDocContentState method putAttribute.

public void putAttribute(String attrName, String value) {
    attributes.put(attrName, value);
    IdGenerationStrategy generationStrategy = getIdGenerator().getGenerationStrategy();
    if (generationStrategy instanceof AsciiDocIdGenerationStrategy) {
        if (ATTRIBUTE_IDPREFIX.equals(attrName)) {
            ((AsciiDocIdGenerationStrategy) generationStrategy).setIdPrefix(value);
        } else if (ATTRIBUTE_IDSEPARATOR.equals(attrName)) {
            ((AsciiDocIdGenerationStrategy) generationStrategy).setIdSeparator(value);
        }
    }
}
Also used : IdGenerationStrategy(org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy)

Example 2 with IdGenerationStrategy

use of org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy in project mylyn.docs by eclipse.

the class MarkdownLanguageTest method testIdGenerationStrategy.

public void testIdGenerationStrategy() {
    IdGenerationStrategy strategy = new MarkdownLanguage().getIdGenerationStrategy();
    assertNotNull(strategy);
    assertEquals(GfmIdGenerationStrategy.class, strategy.getClass());
}
Also used : MarkdownLanguage(org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage) GfmIdGenerationStrategy(org.eclipse.mylyn.wikitext.markdown.internal.GfmIdGenerationStrategy) IdGenerationStrategy(org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy)

Example 3 with IdGenerationStrategy

use of org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy in project mylyn.docs by eclipse.

the class AsciiDocContentState method removeAttribute.

public void removeAttribute(String attrName) {
    attributes.remove(attrName);
    IdGenerationStrategy generationStrategy = getIdGenerator().getGenerationStrategy();
    if (generationStrategy instanceof AsciiDocIdGenerationStrategy) {
        if (ATTRIBUTE_IDPREFIX.equals(attrName)) {
            ((AsciiDocIdGenerationStrategy) generationStrategy).setIdPrefix(AsciiDocContentState.IDPREFIX_DEFAULT_VALUE);
        } else if (ATTRIBUTE_IDSEPARATOR.equals(attrName)) {
            ((AsciiDocIdGenerationStrategy) generationStrategy).setIdSeparator(AsciiDocContentState.IDSEPARATOR_DEFAULT_VALUE);
        }
    }
}
Also used : IdGenerationStrategy(org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy)

Aggregations

IdGenerationStrategy (org.eclipse.mylyn.wikitext.parser.markup.IdGenerationStrategy)3 MarkdownLanguage (org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage)1 GfmIdGenerationStrategy (org.eclipse.mylyn.wikitext.markdown.internal.GfmIdGenerationStrategy)1