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.components;
04:
05: import fitnesse.wiki.*;
06: import fitnesse.wikitext.*;
07:
08: public class PageReferenceRenamer extends ReferenceRenamer {
09: private WikiPage subjectPage;
10: private String newName;
11:
12: public PageReferenceRenamer(WikiPage root) {
13: super (root);
14: }
15:
16: public void renameReferences(WikiPage subjectPage, String newName)
17: throws Exception {
18: this .subjectPage = subjectPage;
19: this .newName = newName;
20: renameReferences();
21: }
22:
23: protected WidgetVisitor getVisitor() {
24: return new PageReferenceRenamingVisitor(subjectPage, newName);
25: }
26:
27: public String getSearchPattern() throws Exception {
28: return subjectPage.getName();
29: }
30: }
|