[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui ...
Christian Bauer
christian at hibernate.org
Fri Jan 11 13:05:14 EST 2008
User: cbauer
Date: 08/01/11 13:05:14
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/ui
UIWikiFormattedText.java
Log:
JBSEAM-2136 - Anchor/linking support for document headlines
Revision Changes Path
1.35 +14 -9 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/UIWikiFormattedText.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIWikiFormattedText.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/UIWikiFormattedText.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- UIWikiFormattedText.java 30 Dec 2007 02:33:26 -0000 1.34
+++ UIWikiFormattedText.java 11 Jan 2008 18:05:14 -0000 1.35
@@ -98,19 +98,24 @@
// Set a customized renderer for parser macro callbacks
class WikiFormattedTextRenderer extends DefaultWikiTextRenderer {
- public String renderInlineLink(WikiLink inlineLink) {
+ public String renderInternalLink(WikiLink internalLink) {
return "<a href=\""
+ (
- inlineLink.isBroken()
- ? inlineLink.getUrl()
- : WikiUtil.renderURL(inlineLink.getFile())
+ internalLink.isBroken()
+ ? internalLink.getUrl()
+ : WikiUtil.renderURL(internalLink.getFile())
+ )
+ + (
+ internalLink.getFragment() != null
+ ? "#"+internalLink.getEncodedFragment()
+ : ""
)
+ "\" target=\""
+ (getAttributes().get(ATTR_INTERNAL_TARGET_FRAME) != null ? getAttributes().get(ATTR_INTERNAL_TARGET_FRAME) : "")
+ "\" class=\""
- + (inlineLink.isBroken() ? getAttributes().get(ATTR_BROKEN_LINK_STYLE_CLASS)
+ + (internalLink.isBroken() ? getAttributes().get(ATTR_BROKEN_LINK_STYLE_CLASS)
: getAttributes().get(ATTR_LINK_STYLE_CLASS)) + "\">"
- + inlineLink.getDescription() + "</a>";
+ + internalLink.getDescription() + "</a>";
}
public String renderExternalLink(WikiLink externalLink) {
@@ -135,10 +140,10 @@
+ attachmentLink.getDescription() + "[" + attachmentNumber + "]" + "</a>";
}
- public String renderThumbnailImageInlineLink(WikiLink inlineLink) {
+ public String renderThumbnailImageLink(WikiLink link) {
// TODO: This is not typesafe and clean, need different rendering strategy for WikiUpload subclasses
- WikiUploadImage image = (WikiUploadImage)inlineLink.getFile();
+ WikiUploadImage image = (WikiUploadImage)link.getFile();
if (image.getThumbnail() == 'F') {
// Full size display, no thumbnail
//TODO: Make sure we really don't need this - but it messes up the comment form conversation:
@@ -158,7 +163,7 @@
String thumbnailUrl = WikiUtil.renderURL(image) + "&thumbnail=true";
return "<a href=\""
- + (inlineLink.isBroken() ? inlineLink.getUrl() : WikiUtil.renderURL(image))
+ + (link.isBroken() ? link.getUrl() : WikiUtil.renderURL(image))
+ "\" target=\""
+ (getAttributes().get(ATTR_INTERNAL_TARGET_FRAME) != null ? getAttributes().get(ATTR_INTERNAL_TARGET_FRAME) : "")
+ "\" class=\""
More information about the jboss-cvs-commits
mailing list