Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-03-19 20:05:46 -0400
committerSusan Franklin2009-03-19 20:05:46 -0400
commitd071ed0a96b5112b88a235fe4afce05c162a97ed (patch)
tree6009bfef0869eb7ca1ec66d8b14a9277cb327ebb
parent49057148d5e67e90f7a682f1321f640dcd9df6ae (diff)
downloadrt.equinox.p2-d071ed0a96b5112b88a235fe4afce05c162a97ed.tar.gz
rt.equinox.p2-d071ed0a96b5112b88a235fe4afce05c162a97ed.tar.xz
rt.equinox.p2-d071ed0a96b5112b88a235fe4afce05c162a97ed.zip
Manual registration of p2 UI policy
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project5
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/OSGI-INF/policy_component.xml7
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties3
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/Activator.java16
5 files changed, 17 insertions, 16 deletions
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project
index f07386b65..9276cae55 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project
@@ -20,11 +20,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ds.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/META-INF/MANIFEST.MF b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/META-INF/MANIFEST.MF
index 334faa895..bcbdba0ad 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/META-INF/MANIFEST.MF
@@ -7,7 +7,6 @@ Bundle-Activator: org.eclipse.equinox.p2.examples.rcp.cloud.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.equinox.ds,
org.eclipse.equinox.p2.ui;bundle-version="1.0.100",
org.eclipse.equinox.p2.metadata;bundle-version="1.0.0",
org.eclipse.equinox.p2.metadata.repository;bundle-version="1.0.0",
@@ -27,4 +26,3 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.equinox.p2.ui.sdk.scheduler;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Service-Component: OSGI-INF/policy_component.xml
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/OSGI-INF/policy_component.xml b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/OSGI-INF/policy_component.xml
deleted file mode 100644
index dde0776e0..000000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/OSGI-INF/policy_component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.p2.examples.rcp.cloud.p2">
- <implementation class="org.eclipse.equinox.p2.examples.rcp.cloud.p2.CloudPolicy"/>
- <service>
- <provide interface="org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy"/>
- </service>
-</scr:component>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties
index 91db6ad8f..5c50a0005 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties
@@ -6,5 +6,4 @@ bin.includes = plugin.xml,\
icons/,\
product_lg.gif,\
splash.bmp,\
- plugin.properties,\
- OSGI-INF/
+ plugin.properties
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/Activator.java b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/Activator.java
index b2f4ebe4d..c12d07d85 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/Activator.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/Activator.java
@@ -1,8 +1,12 @@
package org.eclipse.equinox.p2.examples.rcp.cloud;
+import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
+import org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy;
+import org.eclipse.equinox.p2.examples.rcp.cloud.p2.CloudPolicy;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
/**
* The activator class controls the plug-in life cycle
@@ -15,6 +19,8 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
+ ServiceRegistration policyRegistration;
+
/**
* The constructor
*/
@@ -28,6 +34,8 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ /// XXX register the p2 UI policy
+ registerP2Policy(context);
}
/*
@@ -36,7 +44,11 @@ public class Activator extends AbstractUIPlugin {
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
+ // XXX unregister the UI policy
+ policyRegistration.unregister();
+ policyRegistration = null;
super.stop(context);
+
}
/**
@@ -58,4 +70,8 @@ public class Activator extends AbstractUIPlugin {
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ private void registerP2Policy(BundleContext context) {
+ policyRegistration = context.registerService(Policy.class.getName(), new CloudPolicy(), null);
+ }
}

Back to the top