KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Move arguments describe the data that a processor
17  * provides to its move 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 MoveArguments extends RefactoringArguments {
25     
26     private Object JavaDoc fDestination;
27     private boolean fUpdateReferences;
28     
29     /**
30      * Creates new move arguments.
31      *
32      * @param destination the destination of the move
33      * @param updateReferences <code>true</code> if reference
34      * updating is requested; <code>false</code> otherwise
35      */

36     public MoveArguments(Object JavaDoc destination, boolean updateReferences) {
37         Assert.isNotNull(destination);
38         fDestination= destination;
39         fUpdateReferences= updateReferences;
40     }
41     
42     /**
43      * Returns the destination of the move
44      *
45      * @return the move's destination
46      */

47     public Object JavaDoc getDestination() {
48         return fDestination;
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 "move to " + fDestination.toString() //$NON-NLS-1$
68
+ (fUpdateReferences ? " (update references)" : " (don't update references)"); //$NON-NLS-1$//$NON-NLS-2$
69
}
70 }
71
Popular Tags