diff options
author | Lakshmi Shanmugam | 2017-08-04 11:49:07 +0000 |
---|---|---|
committer | Thomas Watson | 2017-08-04 12:40:48 +0000 |
commit | c0923f655632b34b5c51e0f7dd5d0454fa7b7b13 (patch) | |
tree | f541c7af57da7b15c64a1cc440f6d4d3038af5e0 | |
parent | d7ec2f1b3e4a6bbef347a77e51185e02061523a1 (diff) | |
download | rt.equinox.p2-c0923f655632b34b5c51e0f7dd5d0454fa7b7b13.tar.gz rt.equinox.p2-c0923f655632b34b5c51e0f7dd5d0454fa7b7b13.tar.xz rt.equinox.p2-c0923f655632b34b5c51e0f7dd5d0454fa7b7b13.zip |
Bug 462404: New Eclipse.app layout: "Import > From ExistingI20170816-2000I20170815-2000I20170815-0035I20170814-2000I20170814-0635I20170814-0300I20170813-2000I20170812-1500I20170811-2000I20170810-2000I20170809-2000I20170808-2000I20170807-2000I20170806-2000I20170805-1500I20170804-2000
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>
2 files changed, 25 insertions, 1 deletions
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;
|