KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > core > refactoring > participants > RenameArguments


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ltk.core.refactoring.participants;
12
13 import org.eclipse.core.runtime.Assert;
14
15 /**
16  * Rename arguments describe the data that a processor
17  * provides to its rename participants.
18  * <p>
19  * This class is not intended to be subclassed by clients.
20  * </p>
21  *
22  * @since 3.0
23  */

24 public class RenameArguments extends RefactoringArguments {
25     
26     private String JavaDoc fNewName;
27     private boolean fUpdateReferences;
28     
29     /**
30      * Creates new rename arguments.
31      *
32      * @param newName the new name of the element to be renamed
33      * @param updateReferences <code>true</code> if reference
34      * updating is requested; <code>false</code> otherwise
35      */

36     public RenameArguments(String JavaDoc newName, boolean updateReferences) {
37         Assert.isNotNull(newName);
38         fNewName= newName;
39         fUpdateReferences= updateReferences;
40     }
41     
42     /**
43      * Returns the new element name.
44      *
45      * @return the new element name
46      */

47     public String JavaDoc getNewName() {
48         return fNewName;
49     }
50     
51     /**
52      * Returns whether reference updating is requested or not.
53      *
54      * @return returns <code>true</code> if reference
55      * updating is requested; <code>false</code> otherwise
56      */

57     public boolean getUpdateReferences() {
58         return fUpdateReferences;
59     }
60
61     /**
62      * {@inheritDoc}
63      *
64      * @since 3.2
65      */

66     public String JavaDoc toString() {
67         return "rename to " + fNewName //$NON-NLS-1$
68
+ (fUpdateReferences ? " (update references)" : " (don't update references)"); //$NON-NLS-1$//$NON-NLS-2$
69
}
70 }
71
Popular Tags