Search in sources :

Example 6 with ImageAttributes

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

the class XslfoDocumentBuilderTest method testImageWithHeightInPct.

public void testImageWithHeightInPct() {
    ImageAttributes attributes = new ImageAttributes();
    attributes.setHeight(10);
    attributes.setHeightPercentage(true);
    builder.image(attributes, "some/image.png");
    String generatedContent = out.toString();
    assertTrue(generatedContent.contains("height=\"10%\""));
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes)

Example 7 with ImageAttributes

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

the class MultiplexingDocumentBuilderTest method imageLink.

@Test
public void imageLink() {
    multiplexer.imageLink(new LinkAttributes(), new ImageAttributes(), "https://example.com", "http://example.com/foo.png");
    assertEvents(new ImageLinkEvent(new LinkAttributes(), new ImageAttributes(), "https://example.com", "http://example.com/foo.png"));
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) ImageLinkEvent(org.eclipse.mylyn.wikitext.parser.builder.event.ImageLinkEvent) Test(org.junit.Test)

Example 8 with ImageAttributes

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

the class ConfluenceDocumentBuilderTest method imageWithAlt.

@Test
public void imageWithAlt() {
    builder.beginDocument();
    builder.characters("a ");
    ImageAttributes attributes = new ImageAttributes();
    attributes.setAlt("a value");
    builder.image(attributes, "fooImage.png");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a !fooImage.png|alt=\"a value\"! test\n\n", markup);
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Test(org.junit.Test)

Example 9 with ImageAttributes

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

the class ConfluenceDocumentBuilderTest method imageNoUrl.

@Test
public void imageNoUrl() {
    builder.beginDocument();
    builder.characters("a ");
    builder.image(new ImageAttributes(), null);
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a  test\n\n", markup);
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Test(org.junit.Test)

Example 10 with ImageAttributes

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

the class ConfluenceDocumentBuilderTest method imageWithAltAndTitle.

@Test
public void imageWithAltAndTitle() {
    builder.beginDocument();
    builder.characters("a ");
    ImageAttributes attributes = new ImageAttributes();
    attributes.setAlt("first value");
    attributes.setTitle("second value");
    builder.image(attributes, "fooImage.png");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a !fooImage.png|alt=\"first value\",title=\"second value\"! test\n\n", markup);
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Test(org.junit.Test)

Aggregations

ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)38 Test (org.junit.Test)17 LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)10 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)3 ImageLinkEvent (org.eclipse.mylyn.wikitext.parser.builder.event.ImageLinkEvent)3 ImageEvent (org.eclipse.mylyn.wikitext.parser.builder.event.ImageEvent)2 Align (org.eclipse.mylyn.wikitext.parser.ImageAttributes.Align)1 TableAttributes (org.eclipse.mylyn.wikitext.parser.TableAttributes)1 TableCellAttributes (org.eclipse.mylyn.wikitext.parser.TableCellAttributes)1