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:
11: private String newName;
12:
13: public PageReferenceRenamingVisitor(WikiPage pageToRename,
14: String newName) {
15: this .pageToRename = pageToRename;
16: this .newName = newName;
17: }
18:
19: public void visit(WikiWidget widget) throws Exception {
20: }
21:
22: public void visit(WikiWordWidget widget) throws Exception {
23: widget.renamePageIfReferenced(pageToRename, newName);
24: }
25:
26: public void visit(AliasLinkWidget widget) throws Exception {
27: widget.renamePageIfReferenced(pageToRename, newName);
28: }
29: }
|