1 11 package org.eclipse.pde.internal.ui.refactoring; 12 13 import java.util.HashMap ; 14 15 import org.eclipse.core.resources.IFile; 16 import org.eclipse.core.resources.IProject; 17 import org.eclipse.core.runtime.IPath; 18 import org.eclipse.pde.internal.core.WorkspaceModelManager; 19 import org.eclipse.pde.internal.ui.PDEUIMessages; 20 21 public class FileRenameParticipant extends PDERenameParticipant { 22 23 public String getName() { 24 return PDEUIMessages.FileRenameParticipant_renameFiles; 25 } 26 27 protected boolean initialize(Object element) { 28 if (element instanceof IFile) { 29 IProject project = ((IFile)element).getProject(); 30 if (WorkspaceModelManager.isPluginProject(project)) { 31 IPath path = ((IFile)element).getProjectRelativePath().removeLastSegments(1); 32 String newName = path.append(getArguments().getNewName()).toString(); 33 fProject = project; 34 fElements = new HashMap (); 35 fElements.put(element, newName); 36 return true; 37 } 38 } 39 return false; 40 } 41 42 } 43 | Popular Tags |