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 java.util.regex.*;
06:
07: public class NoteWidget extends ParentWidget {
08: public static final String REGEXP = "^!note [^\r\n]*";
09: private static final Pattern pattern = Pattern
10: .compile("^!note (.*)");
11:
12: public static final String GREY = "#A0A0A0";
13:
14: public NoteWidget(ParentWidget parent, String text)
15: throws Exception {
16: super (parent);
17: Matcher match = pattern.matcher(text);
18: if (match.find())
19: addChildWidgets(match.group(1));
20: }
21:
22: public String render() throws Exception {
23: StringBuffer html = new StringBuffer("<span class=\"note\">");
24: html.append(childHtml()).append("</span>");
25: return html.toString();
26: }
27: }
|