/** * @see #link(Attributes, String, String) */ public final void link(String hrefOrHashName, String text) { link(new LinkAttributes(), hrefOrHashName, text); }
/** * Create a hyperlink whose visual representation is an image. Implementations must apply the attributes to the * image tag. For example, if the builder constructs HTML, the builder would emit * <code><a href="..."><img src="..."/></a></code>. In this case if the attributes define a css class then * the resulting HTML should look like this: <code><a href="..."><img src="..." class="..."/></a></code> * * @param attributes * the attributes of the image, which may be {@link ImageAttributes} * @param href * the url (which may be internal to the page if prefixed with a hash '#') * @param imageUrl * the url of the image, which may be relative * @see #imageLink(Attributes, Attributes, String, String) */ public final void imageLink(Attributes attributes, String href, String imageUrl) { imageLink(new LinkAttributes(), attributes, href, imageUrl); }
/** * @see #imageLink(Attributes, String, String) */ public final void imageLink(String href, String imageUrl) { imageLink(new LinkAttributes(), new ImageAttributes(), href, imageUrl); }
@Override public void emit() { String email = group(1); builder.link(new LinkAttributes(), "mailto:" + email, email); //$NON-NLS-1$ }
@Override public void emit() { getBuilder().characters(group(1)); String linkComposite = group(2); String[] parts = linkComposite.split("\\s*\\|\\s*(?=([^\\!]*\\![^\\!]*\\!)*[^\\!]*$)"); //$NON-NLS-1$ // split on '\s*\|\s*' but make sure the | is not included inside a !..! block // see http://stackoverflow.com/questions/1757065/java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes/1757107#1757107 String text = parts.length > 1 ? parts[0] : null; if (text != null) { text = text.trim(); } String href = parts.length > 1 ? parts[1] : parts[0]; if (href != null) { href = href.trim(); } String tip = parts.length > 2 ? parts[2] : null; if (tip != null) { tip = tip.trim(); } if (text == null || text.length() == 0) { text = href; if (text.charAt(0) == '#') { text = text.substring(1); } } Attributes attributes = new LinkAttributes(); attributes.setTitle(tip); getBuilder().link(attributes, href, text); } }
LinkAttributes attributes = new LinkAttributes(); attributes.setTitle(tip); attributes.setHref(href);
text = text.substring(1); Attributes attributes = new LinkAttributes(); attributes.setTitle(tip); getBuilder().link(attributes, toInternalHref(href), text); } else { LinkAttributes attributes = new LinkAttributes(); attributes.setTitle(tip); attributes.setHref(toInternalHref(href));
@Override public void emit() { String hyperlinkBoundaryText = group(1); String hyperlinkSrc = group(2 + Textile.ATTRIBUTES_GROUP_COUNT); String href = group(3 + Textile.ATTRIBUTES_GROUP_COUNT); String namedLinkUrl = ((TextileContentState) getState()).getNamedLinkUrl(href); if (namedLinkUrl != null) { href = namedLinkUrl; } if (hyperlinkBoundaryText.equals("\"")) { //$NON-NLS-1$ LinkAttributes attributes = new LinkAttributes(); attributes.setHref(href); Textile.configureAttributes(this, attributes, ATTRIBUTES_OFFSET, false); builder.beginSpan(SpanType.LINK, attributes); getMarkupLanguage().emitMarkupLine(parser, state, start(2), hyperlinkSrc, 0); builder.endSpan(); } else { final ImageAttributes attributes = new ImageAttributes(); Textile.configureAttributes(this, attributes, ATTRIBUTES_OFFSET, false); builder.imageLink(attributes, href, hyperlinkSrc); } } }
out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes); if (previous != null) { linkAttributes = new LinkAttributes(); linkAttributes.setTitle(previous.getLabel()); if (navigationImages) { out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes); if (!header && !rootPage) { linkAttributes = new LinkAttributes(); linkAttributes.setTitle(rootBuilder.getTitle()); if (navigationImages) { out.beginBlock(BlockType.TABLE_CELL_NORMAL, tableCellAttributes); if (next != null) { linkAttributes = new LinkAttributes(); linkAttributes.setTitle(next.getLabel()); if (navigationImages) {