Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2017-08-04 07:49:07 -0400
committerLakshmi Shanmugam2017-08-16 06:07:08 -0400
commite54e4fe1a0d2d034e28ba3b50a2fb226595d8565 (patch)
treee48dd74b4b37758d9ce753649498f9ffdea54b46
parent998432930e136609700249beb35b3c3b0931b0b5 (diff)
downloadrt.equinox.p2-e54e4fe1a0d2d034e28ba3b50a2fb226595d8565.tar.gz
rt.equinox.p2-e54e4fe1a0d2d034e28ba3b50a2fb226595d8565.tar.xz
rt.equinox.p2-e54e4fe1a0d2d034e28ba3b50a2fb226595d8565.zip
Bug 462404: New Eclipse.app layout: "Import > From ExistingY20170817-1000U20170817-0400S4_7_1_RC1M20170817-0500
Installation" doesn't accept app bundle When Mac app bundle is provided try to drill down to Contents/Eclipse folder if it exists. Change-Id: I29844aed359b1b062cf209675a993e1ba06d09d3 Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com> (cherry picked from commit c0923f655632b34b5c51e0f7dd5d0454fa7b7b13)
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java20
4 files changed, 27 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF
index aeeaa340f..3be776777 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.ui.importexport;singleton:=true
-Bundle-Version: 1.1.300.qualifier
+Bundle-Version: 1.1.301.qualifier
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/pom.xml b/bundles/org.eclipse.equinox.p2.ui.importexport/pom.xml
index a061a576a..c16b1ec0b 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/pom.xml
@@ -9,6 +9,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.ui.importexport</artifactId>
- <version>1.1.300-SNAPSHOT</version>
+ <version>1.1.301-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
index f06dddec1..e998dc8d2 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
@@ -324,6 +324,7 @@ public abstract class AbstractPage extends WizardPage implements Listener {
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR) {
entryChanged = false;
+ modifyDestinationValue(getDestinationValue());
handleDestinationChanged(getDestinationValue());
}
}
@@ -757,4 +758,9 @@ public abstract class AbstractPage extends WizardPage implements Listener {
protected void addDestinationItem(String value) {
destinationNameField.add(value);
}
+
+ void modifyDestinationValue(String destinationValue) {
+ //Do nothing
+ }
+
} \ No newline at end of file
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