Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2011-01-05 13:28:05 -0500
committerSusan Franklin2011-01-05 13:28:05 -0500
commit5d1d30f8707bd28b96de50a9af5110ec26cdfe7d (patch)
treec8e9d021ca51686264aa63d8b693f755612dd34e /examples
parent7e6f27df83866306243c482b32b4c021bae6b00c (diff)
downloadrt.equinox.p2-5d1d30f8707bd28b96de50a9af5110ec26cdfe7d.tar.gz
rt.equinox.p2-5d1d30f8707bd28b96de50a9af5110ec26cdfe7d.tar.xz
rt.equinox.p2-5d1d30f8707bd28b96de50a9af5110ec26cdfe7d.zip
Bug 311475 - [ui] add Policy API to control whether branded update wizard is used
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java9
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceConstants.java4
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceInitializer.java17
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/updatenotification.pngbin0 -> 242526 bytes
4 files changed, 19 insertions, 11 deletions
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java
index d2df4a112..789c8d676 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@ import org.eclipse.equinox.p2.examples.rcp.cloud.Activator;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.ui.Policy;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.graphics.Point;
/**
* CloudPolicy defines the RCP Cloud Example policies for the p2 UI. The policy
@@ -35,6 +36,12 @@ public class CloudPolicy extends Policy {
.getBoolean(PreferenceConstants.AVAILABLE_GROUP_BY_CATEGORY));
setShowDrilldownRequirements(prefs
.getBoolean(PreferenceConstants.SHOW_DRILLDOWN_REQUIREMENTS));
+ setFilterOnEnv(prefs.getBoolean(PreferenceConstants.FILTER_ON_ENV));
+ setUpdateWizardStyle(prefs.getInt(PreferenceConstants.UPDATE_WIZARD_STYLE));
+ int preferredWidth = prefs.getInt(PreferenceConstants.UPDATE_DETAILS_WIDTH);
+ int preferredHeight = prefs.getInt(PreferenceConstants.UPDATE_DETAILS_HEIGHT);
+ setUpdateDetailsPreferredSize(new Point(preferredWidth, preferredHeight));
+
if (prefs.getBoolean(PreferenceConstants.AVAILABLE_SHOW_ALL_BUNDLES))
setVisibleAvailableIUQuery(QueryUtil.ALL_UNITS);
else
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceConstants.java b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceConstants.java
index b4b72e5c1..257733285 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceConstants.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceConstants.java
@@ -18,4 +18,8 @@ public class PreferenceConstants {
public static final String INSTALLED_SHOW_ALL_BUNDLES = "showAllBundlesInstalled"; //$NON-NLS-1$
public static final String REPOSITORIES_VISIBLE = "repositoriesVisible"; //$NON-NLS-1$
public static final String SHOW_DRILLDOWN_REQUIREMENTS = "showDrilldownRequirements"; //$NON-NLS-1$
+ public static final String UPDATE_WIZARD_STYLE = "updateWizardStyle"; //$NON-NLS-1$
+ public static final String UPDATE_DETAILS_WIDTH = "updateDetailsWidth"; //$NON-NLS-1$
+ public static final String UPDATE_DETAILS_HEIGHT = "updateDetailsHeight"; //$NON-NLS-1$
+ public static final String FILTER_ON_ENV = "filterOnEnv"; //$NON-NLS-1$
}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceInitializer.java b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceInitializer.java
index 8ba7ae8d5..3f26de75a 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceInitializer.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/PreferenceInitializer.java
@@ -10,18 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.examples.rcp.cloud.p2;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.*;
-import org.eclipse.equinox.p2.core.IAgentLocation;
-import org.eclipse.equinox.p2.engine.IProfileRegistry;
-import org.eclipse.equinox.p2.engine.ProfileScope;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.equinox.p2.examples.rcp.cloud.Activator;
import org.eclipse.equinox.p2.ui.Policy;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.ui.statushandlers.StatusManager;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.prefs.BackingStoreException;
+import org.eclipse.swt.SWT;
import org.osgi.service.prefs.Preferences;
/**
@@ -42,5 +35,9 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
node.putBoolean(PreferenceConstants.AVAILABLE_GROUP_BY_CATEGORY, true);
node.putBoolean(PreferenceConstants.SHOW_DRILLDOWN_REQUIREMENTS, false);
node.putInt(PreferenceConstants.RESTART_POLICY, Policy.RESTART_POLICY_PROMPT_RESTART_OR_APPLY);
+ node.putInt(PreferenceConstants.UPDATE_WIZARD_STYLE, Policy.UPDATE_STYLE_MULTIPLE_IUS);
+ node.putBoolean(PreferenceConstants.FILTER_ON_ENV, false);
+ node.putInt(PreferenceConstants.UPDATE_DETAILS_HEIGHT, SWT.DEFAULT);
+ node.putInt(PreferenceConstants.UPDATE_DETAILS_WIDTH, SWT.DEFAULT);
}
}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/updatenotification.png b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/updatenotification.png
new file mode 100644
index 000000000..d3c6f871f
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/updatenotification.png
Binary files differ

Back to the top