KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > refactoring > LaunchConfigurationIProjectRenameParticipant


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.ant.internal.ui.refactoring;
13
14 import org.eclipse.core.resources.IProject;
15 import org.eclipse.core.runtime.CoreException;
16 import org.eclipse.core.runtime.IProgressMonitor;
17 import org.eclipse.ltk.core.refactoring.Change;
18 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
19 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
20 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
21
22 public class LaunchConfigurationIProjectRenameParticipant extends RenameParticipant {
23
24     private IProject fProject;
25
26     /* (non-Javadoc)
27      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
28      */

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

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

44     public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
45         return new RefactoringStatus();
46     }
47
48     /* (non-Javadoc)
49      * @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
50      */

51     public Change createChange(IProgressMonitor pm) throws CoreException {
52         return LaunchConfigurationBuildfileChange.createChangesForProjectRename(fProject, getArguments().getNewName());
53     }
54 }
Popular Tags