KickJava   Java API By Example, From Geeks To Geeks.

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


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
12 package org.eclipse.jdt.internal.debug.core.refactoring;
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.IProgressMonitor;
16
17 import org.eclipse.jdt.core.IPackageFragment;
18
19 import org.eclipse.ltk.core.refactoring.Change;
20 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
21 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
22 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
23
24 public class LaunchConfigurationIPackageFragmentRenameParticipant extends RenameParticipant {
25     
26     private IPackageFragment fPackageFragment;
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         fPackageFragment= (IPackageFragment)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.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
52      */

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