Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java
index fc33368c4..3b787455c 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java
@@ -282,7 +282,7 @@ public class ImportFromInstallationPage extends AbstractImportPage implements IS
final String selectedFileName = dialog.open();
if (selectedFileName != null) {
- setDestinationValue(selectedFileName);
+ modifyDestinationValue(selectedFileName);
handleDestinationChanged(selectedFileName);
}
}
@@ -325,6 +325,24 @@ public class ImportFromInstallationPage extends AbstractImportPage implements IS
}
@Override
+ void modifyDestinationValue(String selectedFileName) {
+ /*
+ * If the destination file is a Mac app bundle, modify the destination
+ * to *.app/Contents/Eclipse if the path exists.
+ */
+ if ("cocoa".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ Path nPath = new Path(selectedFileName);
+ if (nPath.lastSegment().endsWith(".app")) { //$NON-NLS-1$
+ IPath appendedPath = nPath.append("Contents").append("Eclipse");//$NON-NLS-1$ //$NON-NLS-2$
+ if (appendedPath.toFile().exists()) {
+ selectedFileName = appendedPath.toOSString();
+ }
+ }
+ }
+ setDestinationValue(selectedFileName);
+ }
+
+ @Override
protected boolean validDestination() {
if (this.destinationNameField == null)
return true;

Back to the top