01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.wikitext.widgets;
04:
05: import fitnesse.wikitext.*;
06: import java.util.regex.*;
07:
08: public class VirtualWikiWidget extends WikiWidget {
09: public static final String REGEXP = "^!virtualwiki http://[^\r\n]*";
10:
11: private static final Pattern pattern = Pattern
12: .compile("!virtualwiki (http://.*)");
13:
14: public String url;
15:
16: public VirtualWikiWidget(ParentWidget parent, String text)
17: throws Exception {
18: super (parent);
19: Matcher match = pattern.matcher(text);
20: if (match.find())
21: url = match.group(1);
22: }
23:
24: public String render() throws Exception {
25: StringBuffer html = new StringBuffer("");
26: html.append("<span class=\"meta\">");
27: html
28: .append("!virtualwiki has been deprecated. Use the Properties button instead.");
29: html.append("</span>");
30: return html.toString();
31: }
32:
33: public String getRemoteUrl() {
34: return url;
35: }
36: }
|