[ 
https://issues.apache.org/jira/browse/WICKET-731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerolf Seitz closed WICKET-731.
-------------------------------


> make SmartLinkLabel more flexible 
> ----------------------------------
>
>                 Key: WICKET-731
>                 URL: https://issues.apache.org/jira/browse/WICKET-731
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.3.0-beta2
>            Reporter: Gerolf Seitz
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.3.0-beta3
>
>         Attachments: smartlink.patch
>
>
> Right now the SmartLinkLabel class is marked as final and has a package 
> private static method which does the smart link processing. the static method 
> is also used in SmartLinkMultiLineLabel.
> This is a very rigid approach, as it does not allow the SmartLinkLabel class 
> to be extended by subclassing (because of final) or to be customized with a 
> certain api.
> Therefore the following interfaces and classes are introduced:
> interface ILinkParser: provides a method  "String parse(String text)".
> class LinkParser: base implementation of ILinkParser. iterates over the 
> provided patterns and applies the corresponding ILinkRenderStrategy 
> implementations.
> class DefaultLinkParser: uses ILinkRenderStrategies for email addresses and 
> urls (like the "rigid" SmartLinkLabel)
> interface ILinkRenderStrategy: provides a method "String buildLink(String 
> linkTarget)". can be added to LinkParser together with a regex pattern, on 
> which the linkrenderstrategy is applied.
> this may seem like an overkill (compared to the existing versions), but with 
> the new infrastructure it's possible for example to convert CamelCasedWords 
> to links (like it's done in trac) in a matter of a few lines.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to