|
What this is
Other links
The source code/******************************************************************************* * Copyright (c) 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.pde.internal.ui.refactoring; import java.util.HashMap; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.pde.internal.core.WorkspaceModelManager; import org.eclipse.pde.internal.ui.PDEUIMessages; public class FileRenameParticipant extends PDERenameParticipant { public String getName() { return PDEUIMessages.FileRenameParticipant_renameFiles; } protected boolean initialize(Object element) { if (element instanceof IFile) { IProject project = ((IFile) element).getProject(); if (WorkspaceModelManager.isPluginProject(project)) { IPath path = ((IFile) element).getProjectRelativePath().removeLastSegments(1); String newName = path.append(getArguments().getNewName()).toString(); fProject = project; fElements = new HashMap(); fElements.put(element, newName); return true; } } return false; } } |
... this post is sponsored by my books ... | |
![]() #1 New Release! |
![]() FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.