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;
04:
05: import fitnesse.wikitext.widgets.*;
06: import fitnesse.wiki.WikiPage;
07:
08: public class PageReferenceRenamingVisitor implements WidgetVisitor {
09: private WikiPage pageToRename;
10: private String newName;
11:
12: public PageReferenceRenamingVisitor(WikiPage pageToRename,
13: String newName) {
14: this .pageToRename = pageToRename;
15: this .newName = newName;
16: }
17:
18: public void visit(WikiWidget widget) throws Exception {
19: }
20:
21: public void visit(WikiWordWidget widget) throws Exception {
22: widget.renamePageIfReferenced(pageToRename, newName);
23: }
24:
25: public void visit(AliasLinkWidget widget) throws Exception {
26: widget.renamePageIfReferenced(pageToRename, newName);
27: }
28: }
|