diff options
6 files changed, 53 insertions, 20 deletions
diff --git a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/AgentManager.java b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/AgentManager.java index 4fbbd8f16..c8faaebbd 100644 --- a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/AgentManager.java +++ b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/core/AgentManager.java @@ -23,8 +23,14 @@ import java.util.Set; */ public interface AgentManager { + /** + * Specifies the location of the shared pool as a system property. + * The special value "@none" indicates that no shared pool should be used. + */ public static final String PROP_BUNDLE_POOL_LOCATION = "oomph.p2.pool"; + public static final String BUNDLE_POOL_LOCATION_NONE = "@none"; + public Agent getCurrentAgent(); public File getDefaultAgentLocation(); diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java index 0f0727339..c5df0a883 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java @@ -157,7 +157,11 @@ public class ProductPage extends SetupWizardPage { public static final String PAGE_NAME = "ProductPage"; - private static final boolean SHOW_BUNDLE_POOL_UI = PropertiesUtil.getProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION) == null; + /** + * Adds the p2 bundle pool buttons to the UI if the bundle pool location isn't specified or isn't specified to be '@none'. + */ + private static final boolean SHOW_BUNDLE_POOL_UI = PropertiesUtil.getProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION) == null + || !AgentManager.BUNDLE_POOL_LOCATION_NONE.equalsIgnoreCase(PropertiesUtil.getProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION)); private static final Product NO_PRODUCT = createNoProduct(); @@ -1170,7 +1174,7 @@ public class ProductPage extends SetupWizardPage } else { - System.clearProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION); + System.setProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION, AgentManager.BUNDLE_POOL_LOCATION_NONE); } currentBundlePool = pool; diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java index 633201805..65b345130 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java @@ -1161,7 +1161,7 @@ public class SimpleVariablePage extends SimpleInstallerPage } else { - System.clearProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION); + System.setProperty(AgentManager.PROP_BUNDLE_POOL_LOCATION, AgentManager.BUNDLE_POOL_LOCATION_NONE); } JRE jre = javaController.getJRE(); diff --git a/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java b/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java index aee8a566c..ebb7f7db7 100644 --- a/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java +++ b/plugins/org.eclipse.oomph.setup.p2/src/org/eclipse/oomph/setup/p2/impl/P2TaskImpl.java @@ -772,7 +772,7 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task String bundlePoolLocation = (String)context.get(AgentManager.PROP_BUNDLE_POOL_LOCATION); boolean sharedPool; - if (bundlePoolLocation != null) + if (bundlePoolLocation != null && !AgentManager.BUNDLE_POOL_LOCATION_NONE.equalsIgnoreCase(bundlePoolLocation)) { sharedPool = true; bundlePool = P2Util.getAgentManager().getBundlePool(new File(bundlePoolLocation)); diff --git a/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/ProgressPage.java b/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/ProgressPage.java index 60cf6db45..f7e145d37 100644 --- a/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/ProgressPage.java +++ b/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/ProgressPage.java @@ -11,6 +11,7 @@ package org.eclipse.oomph.setup.ui.wizards; import org.eclipse.oomph.base.util.BaseUtil; +import org.eclipse.oomph.internal.setup.SetupProperties; import org.eclipse.oomph.internal.ui.AccessUtil; import org.eclipse.oomph.internal.ui.OomphAdapterFactoryContentProvider; import org.eclipse.oomph.setup.Installation; @@ -50,6 +51,7 @@ import org.eclipse.oomph.util.IORuntimeException; import org.eclipse.oomph.util.IOUtil; import org.eclipse.oomph.util.OS; import org.eclipse.oomph.util.Pair; +import org.eclipse.oomph.util.PropertiesUtil; import org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport; import org.eclipse.emf.common.util.BasicEList; @@ -350,27 +352,36 @@ public class ProgressPage extends SetupWizardPage if (getWizard().getOS().isCurrentOS()) { - if (getTrigger() == Trigger.BOOTSTRAP) + // If the property is not set, create a check box for controlling launchAutomatically. Otherwise use the property value directly. + final Boolean launchAutomaticallyPropertyValue = PropertiesUtil.getBoolean(SetupProperties.PROP_SETUP_LAUNCH_AUTOMATICALLY); + if (launchAutomaticallyPropertyValue == null) { - launchButton = buttonBar.addCheckButton("Launch automatically", "Launch the installed product when all setup tasks have performed successfully", true, - "launchAutomatically"); + if (getTrigger() == Trigger.BOOTSTRAP) + { + launchButton = buttonBar.addCheckButton("Launch automatically", "Launch the installed product when all setup tasks have performed successfully", true, + "launchAutomatically"); + } + else + { + launchButton = buttonBar.addCheckButton("Restart automatically if needed", + "Restart the current product if the installation has been changed by setup tasks", false, "restartIfNeeded"); + } + + launchAutomatically = launchButton.getSelection(); + launchButton.addSelectionListener(new SelectionAdapter() + { + @Override + public void widgetSelected(SelectionEvent e) + { + launchAutomatically = launchButton.getSelection(); + } + }); + AccessUtil.setKey(launchButton, "launch"); } else { - launchButton = buttonBar.addCheckButton("Restart automatically if needed", - "Restart the current product if the installation has been changed by setup tasks", false, "restartIfNeeded"); + launchAutomatically = launchAutomaticallyPropertyValue; } - - launchAutomatically = launchButton.getSelection(); - launchButton.addSelectionListener(new SelectionAdapter() - { - @Override - public void widgetSelected(SelectionEvent e) - { - launchAutomatically = launchButton.getSelection(); - } - }); - AccessUtil.setKey(launchButton, "launch"); } } diff --git a/plugins/org.eclipse.oomph.setup/src/org/eclipse/oomph/internal/setup/SetupProperties.java b/plugins/org.eclipse.oomph.setup/src/org/eclipse/oomph/internal/setup/SetupProperties.java index aad8db5c3..3b380528f 100644 --- a/plugins/org.eclipse.oomph.setup/src/org/eclipse/oomph/internal/setup/SetupProperties.java +++ b/plugins/org.eclipse.oomph.setup/src/org/eclipse/oomph/internal/setup/SetupProperties.java @@ -35,6 +35,9 @@ public interface SetupProperties public static final String PROP_SETUP_MIRRORS = "eclipse.p2.mirrors"; + /** + * Automatically accepts unsigned content if set to 'true'. + */ public static final String PROP_SETUP_UNSIGNED_POLICY = "eclipse.p2.unsignedPolicy"; public static final String PROP_SETUP_REMOTE_DEBUG = "oomph.setup.remote.debug"; @@ -45,6 +48,10 @@ public interface SetupProperties public static final String PROP_SETUP_SYNC_TIMEOUT = "oomph.setup.sync.timeout"; + /** + * The value 'simple' starts the installer in simple mode, 'advanced' in advanced mode. + * The property is not case sensitive. + */ public static final String PROP_SETUP_INSTALLER_MODE = "oomph.setup.installer.mode"; public static final String PROP_SETUP_PRODUCT_CATALOG_FILTER = "oomph.setup.product.catalog.filter"; @@ -64,4 +71,9 @@ public interface SetupProperties public static final String PROP_INSTALLER_UPDATE_URL = "oomph.installer.update.url"; public static final String PROP_SETUP_USER_AGENT = "oomph.userAgent"; + + /** + * If set, the 'launch automatically' and the 'restart if needed' check boxes are not displayed; instead the property value (true or false) is used directly. + */ + public static final String PROP_SETUP_LAUNCH_AUTOMATICALLY = "oomph.setup.launch.automatically"; } |