KickJava   Java API By Example, From Geeks To Geeks.

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


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.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 /**
23  */

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

31     protected boolean initialize(Object JavaDoc element) {
32         fType= (IType) element;
33         return true;
34     }
35     
36     /* (non-Javadoc)
37      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
38      */

39     public String JavaDoc getName() {
40         return RefactoringMessages.LaunchConfigurationParticipant_0;
41     }
42     
43     /* (non-Javadoc)
44      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
45      */

46     public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
47         return new RefactoringStatus();
48     }
49
50     /* (non-Javadoc)
51      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
52      */

53     public Change createChange(IProgressMonitor pm) throws CoreException {
54         return JDTDebugRefactoringUtil.createChangesForTypeRename(fType, getArguments().getNewName());
55     }
56 }
57
Popular Tags