Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-03-19 19:02:33 -0400
committerSusan Franklin2009-03-19 19:02:33 -0400
commit8dae93c23820913653519ff2ed2e3e0c054dc387 (patch)
treedc6e4b092f69379a61683836a279b7cb007aa202 /examples
parentddc883153787c1359874444b8ab171b6b46bbddf (diff)
downloadrt.equinox.p2-8dae93c23820913653519ff2ed2e3e0c054dc387.tar.gz
rt.equinox.p2-8dae93c23820913653519ff2ed2e3e0c054dc387.tar.xz
rt.equinox.p2-8dae93c23820913653519ff2ed2e3e0c054dc387.zip
Bug 256361 - [ui] define clearly the rules of engagement for accessing and setting default Policy
Diffstat (limited to 'examples')
-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.MF1
-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.java9
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java27
6 files changed, 42 insertions, 10 deletions
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project
index 9276cae55..f07386b65 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/.project
@@ -20,6 +20,11 @@
<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 bcbdba0ad..669a95fc7 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
@@ -26,3 +26,4 @@ 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
new file mode 100644
index 000000000..a861d350c
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/OSGI-INF/policy_component.xml
@@ -0,0 +1,7 @@
+<?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.ui.sdk">
+ <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 5c50a0005..91db6ad8f 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/build.properties
@@ -6,4 +6,5 @@ bin.includes = plugin.xml,\
icons/,\
product_lg.gif,\
splash.bmp,\
- plugin.properties
+ plugin.properties,\
+ OSGI-INF/
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 0d8532c29..8e1336a8a 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
@@ -29,8 +29,6 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
- /// XXX initialize the p2 UI policy
- initializeP2Policies();
}
/*
@@ -61,11 +59,4 @@ public class Activator extends AbstractUIPlugin {
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
-
- private void initializeP2Policies() {
- Policy policy = Policy.getDefault();
-
- // XXX User has no access to manipulate repositories
- policy.setRepositoryManipulator(null);
- }
}
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
new file mode 100644
index 000000000..f307bb8d7
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.cloud/src/org/eclipse/equinox/p2/examples/rcp/cloud/p2/CloudPolicy.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.examples.rcp.cloud.p2;
+
+import org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy;
+
+/**
+ * CloudPolicy defines the RCP Cloud Example policies for the
+ * p2 UI. The policy is declared as an OSGi service in
+ * the policy_component.xml file.
+ *
+ * @since 3.5
+ */
+public class CloudPolicy extends Policy {
+ public CloudPolicy() {
+ // XXX User has no access to manipulate repositories
+ setRepositoryManipulator(null);
+}
+}

Back to the top