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:
11: private String newName;
12:
13: public PageReferenceRenamer(WikiPage root) {
14: super (root);
15: }
16:
17: public void renameReferences(WikiPage subjectPage, String newName)
18: throws Exception {
19: this .subjectPage = subjectPage;
20: this .newName = newName;
21: renameReferences();
22: }
23:
24: protected WidgetVisitor getVisitor() {
25: return new PageReferenceRenamingVisitor(subjectPage, newName);
26: }
27:
28: public String getSearchPattern() throws Exception {
29: return subjectPage.getName();
30: }
31: }
|