KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > refactoring > JavaBreakpointITypeRenameParticipant


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.jdt.internal.debug.core.refactoring;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.jdt.core.IType;
16 import org.eclipse.ltk.core.refactoring.Change;
17 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
18 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
19 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
20
21 /**
22  * Participant for IType rename
23  */

24 public class JavaBreakpointITypeRenameParticipant extends RenameParticipant {
25
26     private IType fType;
27
28     /* (non-Javadoc)
29      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor,
30      * java.lang.Object)
31      */

32     public boolean initialize(Object JavaDoc element) {
33         fType= (IType)element;
34         return true;
35     }
36
37     /* (non-Javadoc)
38      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor,
39      * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
40      */

41     public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
42         return new RefactoringStatus();
43     }
44
45     /* (non-Javadoc)
46      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
47      */

48     public Change createChange(IProgressMonitor pm) throws CoreException {
49         return JavaBreakpointTypeChange.createChangesForTypeRename(fType, getArguments().getNewName());
50     }
51
52     /* (non-Javadoc)
53      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
54      */

55     public String JavaDoc getName() {
56         return RefactoringMessages.JavaBreakpointITypeRenameParticipant_0; //$NON-NLS-1$
57
}
58 }
59
Popular Tags