Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2014-10-22 11:58:49 -0400
committerFred Bricon2014-10-22 13:00:24 -0400
commit1b6e6eca7a13f3029869e7ebbeef719dcf8f0133 (patch)
tree23227caf7c6245e39cc4d08ba93a160712b8f321 /org.eclipse.m2e.refactoring
parent09b93bbf1bceb33bc9e9cf721ad5fee2f44f84a0 (diff)
downloadm2e-core-1b6e6eca7a13f3029869e7ebbeef719dcf8f0133.tar.gz
m2e-core-1b6e6eca7a13f3029869e7ebbeef719dcf8f0133.tar.xz
m2e-core-1b6e6eca7a13f3029869e7ebbeef719dcf8f0133.zip
432616 : fix rename artifact for all Maven projects
Change-Id: I667257ea9ee736546016310b1949e8a1621efb8f Signed-off-by: Fred Bricon <fbricon@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.refactoring')
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java
index 10580726..0c6bac94 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java
@@ -19,6 +19,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
@@ -43,8 +44,11 @@ public class RenameArtifactHandler extends AbstractHandler {
Object element = ((IStructuredSelection) selection).getFirstElement();
if(element instanceof IFile) {
rename((IFile) element);
- } else if(element instanceof IProject) {
- IProject project = (IProject) element;
+ } else if(element instanceof IAdaptable) {
+ IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ if(project == null) {
+ return null;
+ }
IFile file = project.getFile("pom.xml"); //$NON-NLS-1$
if(file != null) {
rename(file);

Back to the top