KickJava   Java API By Example, From Geeks To Geeks.

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


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.IJavaProject;
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 /**
25  * Provides a rename participant for java projects with respect to launch configurations
26  */

27 public class LaunchConfigurationIJavaProjectRenameParticipant extends RenameParticipant {
28
29     /**
30      * the project to rename
31      */

32     private IJavaProject fJavaProject;
33
34     /* (non-Javadoc)
35      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
36      */

37     protected boolean initialize(Object JavaDoc element) {
38         fJavaProject = (IJavaProject) element;
39         return true;
40     }
41     
42     /* (non-Javadoc)
43      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
44      */

45     public String JavaDoc getName() {
46         return RefactoringMessages.LaunchConfigurationParticipant_0;
47     }
48
49     /* (non-Javadoc)
50      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
51      */

52     public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
53         return new RefactoringStatus();
54     }
55
56     /* (non-Javadoc)
57      * @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
58      */

59     public Change createChange(IProgressMonitor pm) throws CoreException {
60         return JDTDebugRefactoringUtil.createChangesForProjectRename(fJavaProject, getArguments().getNewName());
61     }
62 }
63
Popular Tags