summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authoryoungm2012-09-02 16:35:57 (EDT)
committer Igor Fedorenko2012-09-03 06:39:04 (EDT)
commit4bfb8fc6a9e0c01b1c504293c35f4aec3fea6d01 (patch)
treec8079d593d735895483e713d5bc5eaae5602e976
parent84669a40d65c3cb133251ad5fca85d4f839c6e13 (diff)
downloadm2e-core-4bfb8fc6a9e0c01b1c504293c35f4aec3fea6d01.zip
m2e-core-4bfb8fc6a9e0c01b1c504293c35f4aec3fea6d01.tar.gz
m2e-core-4bfb8fc6a9e0c01b1c504293c35f4aec3fea6d01.tar.bz2
388508 Support forcing rename as part of MavenImportWizard. Update MavenProjectCheckoutJob to always force a rename on update.releases/1.2/1.2.0.20120903-1050milestones/1.2/1.2.0.20120903-1050
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java7
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java10
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java2
3 files changed, 17 insertions, 2 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java
index 6d3864a..2cae6ce 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java
@@ -91,6 +91,8 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
private List<String> locations;
private boolean showLocation = true;
+
+ private boolean basedirRemameRequired = false;
private boolean initialized = false;
@@ -112,6 +114,10 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
this(importConfiguration, locations);
this.mappingConfiguration = mappingConfiguration;
}
+
+ public void setBasedirRemameRequired(boolean basedirRemameRequired) {
+ this.basedirRemameRequired = basedirRemameRequired;
+ }
public void init(IWorkbench workbench, IStructuredSelection selection) {
super.init(workbench, selection);
@@ -136,6 +142,7 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
page = new MavenImportWizardPage(importConfiguration, workingSets);
page.setLocations(locations);
page.setShowLocation(showLocation);
+ page.setBasedirRemameRequired(basedirRemameRequired);
addPage(page);
if(getDiscovery() != null) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
index 052988e..323833e 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
@@ -94,6 +94,8 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
private WorkingSetGroup workingSetGroup;
private boolean showLocation = true;
+
+ private boolean basedirRemameRequired = false;
private final List<IWorkingSet> workingSets;
@@ -117,6 +119,10 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
this.locations = locations;
}
+ public void setBasedirRemameRequired(boolean basedirRemameRequired) {
+ this.basedirRemameRequired = basedirRemameRequired;
+ }
+
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(3, false));
@@ -503,10 +509,10 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
if(showLocation) {
String location = rootDirectoryCombo.getText().trim();
if (location.length() > 0) {
- return new LocalProjectScanner(root, location, false, modelManager);
+ return new LocalProjectScanner(root, location, basedirRemameRequired, modelManager);
}
} else if(locations != null && !locations.isEmpty()) {
- return new LocalProjectScanner(root, locations, false, modelManager);
+ return new LocalProjectScanner(root, locations, basedirRemameRequired, modelManager);
}
// empty scanner
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
index 3a6f682..85bd4a6 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
@@ -221,6 +221,7 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
public void run() {
MavenImportWizard wizard = new MavenImportWizard(configuration, collectedLocations,
mappingConfiguration);
+ wizard.setBasedirRemameRequired(true);
WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard);
int res = dialog.open();
if(res == Window.CANCEL) {
@@ -251,6 +252,7 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
MavenImportWizard wizard = new MavenImportWizard(configuration, collectedLocations);
+ wizard.setBasedirRemameRequired(true);
WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard);
int res = dialog.open();
if(res == Window.CANCEL) {