KickJava   Java API By Example, From Geeks To Geeks.

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


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.ant.internal.ui.refactoring;
12
13 import org.eclipse.core.resources.IFile;
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.IProgressMonitor;
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 public class LaunchConfigurationBuildfileRenameParticipant extends RenameParticipant {
22
23     private IFile fFile;
24
25     /* (non-Javadoc)
26      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
27      */

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

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

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

50     public Change createChange(IProgressMonitor pm) throws CoreException {
51         return LaunchConfigurationBuildfileChange.createChangesForBuildfileRename(fFile, getArguments().getNewName());
52     }
53 }
Popular Tags