Search in sources :

Example 26 with LinkAttributes

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

the class TextileDocumentBuilderTest method testExternalLink.

public void testExternalLink() {
    builder.beginDocument();
    builder.characters("an ");
    builder.link(new LinkAttributes(), "http://example.com/", "external link");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("an \"external link\":http://example.com/ test\n\n", markup);
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes)

Example 27 with LinkAttributes

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

the class TextileDocumentBuilderTest method testLink.

public void testLink() {
    builder.beginDocument();
    builder.characters("a ");
    builder.link(new LinkAttributes(), "#foo", "link to foo");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a \"link to foo\":#foo test\n\n", markup);
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes)

Example 28 with LinkAttributes

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

the class TextileDocumentBuilderTest method testImageLink.

public void testImageLink() {
    builder.beginDocument();
    builder.characters("a ");
    builder.imageLink(new LinkAttributes(), new ImageAttributes(), "#foo", "fooImage.png");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a !fooImage.png!:#foo test\n\n", markup);
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes)

Example 29 with LinkAttributes

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

the class Link method emit.

@Override
public void emit(DocumentBuilder builder) {
    LinkAttributes attributes = new LinkAttributes();
    attributes.setTitle(title);
    attributes.setHref(href);
    builder.beginSpan(SpanType.LINK, attributes);
    InlineParser.emit(builder, getContents());
    builder.endSpan();
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes)

Example 30 with LinkAttributes

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

the class AnchorLinkReplacementTokenProcessor method emit.

@Override
public void emit() {
    LinkAttributes attribute = new LinkAttributes();
    attribute.setId(group(1));
    // $NON-NLS-1$
    builder.link(attribute, null, "");
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes)

Aggregations

LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)45 Test (org.junit.Test)16 ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)12 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)10 ImageLinkEvent (org.eclipse.mylyn.wikitext.parser.builder.event.ImageLinkEvent)5 TableAttributes (org.eclipse.mylyn.wikitext.parser.TableAttributes)2 LinkEvent (org.eclipse.mylyn.wikitext.parser.builder.event.LinkEvent)2 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1 IContainer (org.eclipse.core.resources.IContainer)1 IFile (org.eclipse.core.resources.IFile)1 IResource (org.eclipse.core.resources.IResource)1 IPath (org.eclipse.core.runtime.IPath)1 BadLocationException (org.eclipse.jface.text.BadLocationException)1 IDocument (org.eclipse.jface.text.IDocument)1 IRegion (org.eclipse.jface.text.IRegion)1 Region (org.eclipse.jface.text.Region)1 IHyperlink (org.eclipse.jface.text.hyperlink.IHyperlink)1 ListAttributes (org.eclipse.mylyn.wikitext.parser.ListAttributes)1 MarkupParser (org.eclipse.mylyn.wikitext.parser.MarkupParser)1