Search in sources :

Example 41 with Attributes

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

the class DocBookDocumentBuilderTest method testOrderedListUpperalphaType.

public void testOrderedListUpperalphaType() {
    builder.beginDocument();
    ListAttributes listAttributes = new ListAttributes();
    listAttributes.setCssStyle("list-style-type: upper-alpha;");
    builder.beginBlock(BlockType.NUMERIC_LIST, listAttributes);
    builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
    builder.characters("item");
    // LI
    builder.endBlock();
    // OL
    builder.endBlock();
    builder.endDocument();
    String docbook = out.toString();
    String expectedContent = "<orderedlist numeration=\"upperalpha\"><listitem><para>item</para></listitem></orderedlist>";
    assertEquals(DOCBOOK_BEGIN_CHAPTER + expectedContent + DOCBOOK_END_CHAPTER, docbook);
}
Also used : ListAttributes(org.eclipse.mylyn.wikitext.parser.ListAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) ListAttributes(org.eclipse.mylyn.wikitext.parser.ListAttributes) TableAttributes(org.eclipse.mylyn.wikitext.parser.TableAttributes)

Example 42 with Attributes

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

the class DocBookDocumentBuilderTest method testOrderedListLowerromanType.

public void testOrderedListLowerromanType() {
    builder.beginDocument();
    ListAttributes listAttributes = new ListAttributes();
    listAttributes.setCssStyle("list-style-type: lower-roman;");
    builder.beginBlock(BlockType.NUMERIC_LIST, listAttributes);
    builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
    builder.characters("item");
    // LI
    builder.endBlock();
    // OL
    builder.endBlock();
    builder.endDocument();
    String docbook = out.toString();
    String expectedContent = "<orderedlist numeration=\"lowerroman\"><listitem><para>item</para></listitem></orderedlist>";
    assertEquals(DOCBOOK_BEGIN_CHAPTER + expectedContent + DOCBOOK_END_CHAPTER, docbook);
}
Also used : ListAttributes(org.eclipse.mylyn.wikitext.parser.ListAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) ListAttributes(org.eclipse.mylyn.wikitext.parser.ListAttributes) TableAttributes(org.eclipse.mylyn.wikitext.parser.TableAttributes)

Example 43 with Attributes

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

the class EventDocumentBuilderTest method beginBlock.

@Test
public void beginBlock() {
    builder.beginBlock(BlockType.PREFORMATTED, new Attributes());
    assertEvents(new BeginBlockEvent(BlockType.PREFORMATTED, 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) BeginBlockEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent) Test(org.junit.Test)

Example 44 with Attributes

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

the class XslfoDocumentBuilderTest method testMark.

public void testMark() {
    builder.beginDocument();
    builder.characters("normal text ");
    builder.beginSpan(SpanType.MARK, new Attributes());
    builder.characters("marked text");
    builder.endSpan();
    builder.endDocument();
    String generatedContent = out.toString();
    String expectedContent = "normal text <inline font-style=\"italic\">marked text</inline>";
    assertEquals(XSLFO_BEGIN + expectedContent + XSLFO_END, generatedContent);
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes)

Example 45 with Attributes

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

the class LinkEventTest method equals.

@Test
public void equals() {
    assertEquality(new LinkEvent(new Attributes(), "#name", "text"), new LinkEvent(new Attributes(), "#name", "text"));
    assertInequality(new LinkEvent(new Attributes(), "#name", "text"), new LinkEvent(new Attributes(), "#name2", "text"));
    assertInequality(new LinkEvent(new Attributes(), "#name", "text"), new LinkEvent(new Attributes(), "#name", "text2"));
}
Also used : LinkEvent(org.eclipse.mylyn.wikitext.parser.builder.event.LinkEvent) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) Test(org.junit.Test)

Aggregations

Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)428 LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)248 ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)223 Test (org.junit.Test)176 Matcher (java.util.regex.Matcher)33 ListAttributes (org.eclipse.mylyn.wikitext.parser.ListAttributes)29 TableAttributes (org.eclipse.mylyn.wikitext.parser.TableAttributes)17 StringWriter (java.io.StringWriter)14 BlockType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.BlockType)12 HtmlDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)10 Pattern (java.util.regex.Pattern)9 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)9 SpanStrategies (org.eclipse.mylyn.wikitext.html.internal.SpanStrategies)8 Block (org.eclipse.mylyn.wikitext.parser.markup.Block)8 SpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SpanStrategy)6 SubstitutionBlockStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy)6 SubstitutionSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy)6 SubstitutionWithoutCssSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy)6 TableCellAttributes (org.eclipse.mylyn.wikitext.parser.TableCellAttributes)6 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)6