Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-01-06 21:55:12 +0000
committerSusan Franklin2010-01-06 21:55:12 +0000
commitd40ef70a31cdf65287f67ac85f1e634c430ef599 (patch)
tree9262c126f612678e47cc97eb81e0359909f4a9be
parent62fb29dbad150f23a8f9ec3d4f5349e4e22c3ac9 (diff)
downloadrt.equinox.p2-d40ef70a31cdf65287f67ac85f1e634c430ef599.tar.gz
rt.equinox.p2-d40ef70a31cdf65287f67ac85f1e634c430ef599.tar.xz
rt.equinox.p2-d40ef70a31cdf65287f67ac85f1e634c430ef599.zip
Bug 298993 - [ui] get if of p2.common bundle
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/OSGI-INF/licenseManager_component.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/SimpleLicenseManager.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LicenseManager.java84
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html5
-rw-r--r--org.eclipse.equinox.p2.releng/R3_6_api_cleanup_projectSet.psf1
9 files changed, 96 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/OSGI-INF/licenseManager_component.xml b/bundles/org.eclipse.equinox.p2.ui.sdk/OSGI-INF/licenseManager_component.xml
index 74a56977a..bdaeb067d 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk/OSGI-INF/licenseManager_component.xml
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk/OSGI-INF/licenseManager_component.xml
@@ -2,6 +2,6 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.p2.ui.sdk.licenseManager">
<implementation class="org.eclipse.equinox.internal.p2.ui.sdk.SimpleLicenseManager"/>
<service>
- <provide interface="org.eclipse.equinox.p2.common.LicenseManager"/>
+ <provide interface="org.eclipse.equinox.p2.ui.LicenseManager"/>
</service>
</scr:component>
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java
index f1c80c7b0..1c24767c2 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java
@@ -10,13 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.sdk;
+import org.eclipse.equinox.p2.ui.LicenseManager;
+
import java.io.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.ui.sdk.prefs.PreferenceConstants;
import org.eclipse.equinox.internal.p2.ui.sdk.prefs.PreferenceInitializer;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
-import org.eclipse.equinox.p2.common.LicenseManager;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.ProfileScope;
import org.eclipse.equinox.p2.ui.Policy;
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/SimpleLicenseManager.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/SimpleLicenseManager.java
index e492a237e..0d5116797 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/SimpleLicenseManager.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/SimpleLicenseManager.java
@@ -11,13 +11,14 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.sdk;
+import org.eclipse.equinox.p2.ui.LicenseManager;
+
import java.io.*;
import java.util.*;
import javax.xml.parsers.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.provisional.p2.metadata.ILicense;
-import org.eclipse.equinox.p2.common.LicenseManager;
import org.eclipse.ui.statushandlers.StatusManager;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
index fdf72dafe..70b4ba85d 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
@@ -11,6 +11,8 @@
package org.eclipse.equinox.internal.p2.ui.actions;
+import org.eclipse.equinox.p2.ui.LicenseManager;
+
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IStatus;
@@ -20,7 +22,6 @@ import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.equinox.internal.p2.ui.*;
import org.eclipse.equinox.internal.p2.ui.model.CategoryElement;
import org.eclipse.equinox.internal.p2.ui.model.IIUElement;
-import org.eclipse.equinox.p2.common.LicenseManager;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java
index f7777402a..46355dc16 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java
@@ -20,7 +20,6 @@ import org.eclipse.equinox.internal.p2.ui.dialogs.ILayoutConstants;
import org.eclipse.equinox.internal.p2.ui.viewers.IUColumnConfig;
import org.eclipse.equinox.internal.provisional.p2.metadata.ILicense;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.common.LicenseManager;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LicenseManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LicenseManager.java
new file mode 100644
index 000000000..9b9fd60be
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LicenseManager.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 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.ui;
+
+import java.io.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.ILicense;
+
+/**
+ * LicenseManager defines a service which records the licenses that have been
+ * accepted in the course of installing or updating software. It can be used to determine
+ * whether a particular license should be presented to a user for acceptance, and
+ * to record the user's decision.
+ *
+ * @since 2.0
+ */
+public abstract class LicenseManager {
+
+ /**
+ * Record the acceptance of the specified license.
+ *
+ * @param license the license to be accepted
+ *
+ * @return <code>true</code> if the license was recorded as accepted, <code>false</code> if
+ * it was not.
+ *
+ */
+ public abstract boolean accept(ILicense license);
+
+ /**
+ * Record the rejection of the specified license.
+ *
+ * @param license the license to be rejected
+ *
+ * @return <code>true</code> if the license was recorded as rejected, <code>false</code> if
+ * it was not.
+ *
+ */
+ public abstract boolean reject(ILicense license);
+
+ /**
+ * Return a boolean indicating whether a particular license has previously
+ * been accepted.
+ *
+ * @param license the license in question
+ *
+ * @return <code>true</code> if the license has previously been accepted,
+ * <code>false</code> if it has not been accepted before.
+ *
+ */
+ public abstract boolean isAccepted(ILicense license);
+
+ /**
+ * Return a boolean indicating whether any licenses have been
+ * accepted.
+ *
+ * @return <code>true</code> if accepted licenses have been recorded,
+ * <code>false</code> if there have been no licenses accepted.
+
+ */
+ public abstract boolean hasAcceptedLicenses();
+
+ /**
+ * Write the accepted licenses list to the specified stream.
+ * @param stream the stream to which licenses should be written
+ * @throws IOException
+ */
+ public abstract void write(OutputStream stream) throws IOException;
+
+ /**
+ * Read the accepted licenses list from the specified stream.
+ * @param stream the stream from which to read the licenses
+ * @throws IOException
+ */
+ public abstract void read(InputStream stream) throws IOException;
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
index 745c4ae8e..0d7db008d 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
@@ -20,7 +20,6 @@ import org.eclipse.equinox.internal.p2.ui.*;
import org.eclipse.equinox.internal.p2.ui.dialogs.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
-import org.eclipse.equinox.p2.common.LicenseManager;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html
index 193219d57..8dced36e6 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html
@@ -22,6 +22,11 @@ or launch provisioning wizards.
<li><b>Policy</b> defines those aspects of the provisioning UI that can be configured
by clients.
</li>
+<li><b>LicenseManager</b> describes a service which accepts or rejects
+licenses and remembers the accepted licenses. Clients should register
+an implementation of LicenseManager in order to remember the
+licenses.
+</li>
<li>Various <b>pages</b> define reusable pages that can be hosted inside wizards
and dialogs. In general, the pages are meant to be contributed by extension point.
In some cases, direct instantiation of the pages is permitted. See the individual page
diff --git a/org.eclipse.equinox.p2.releng/R3_6_api_cleanup_projectSet.psf b/org.eclipse.equinox.p2.releng/R3_6_api_cleanup_projectSet.psf
index 3b7dcd6c2..5f1fff49d 100644
--- a/org.eclipse.equinox.p2.releng/R3_6_api_cleanup_projectSet.psf
+++ b/org.eclipse.equinox.p2.releng/R3_6_api_cleanup_projectSet.psf
@@ -9,7 +9,6 @@
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.optimizers,org.eclipse.equinox.p2.artifact.optimizers,R3_6_api_cleanup"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.processors,org.eclipse.equinox.p2.artifact.processors,R3_6_api_cleanup"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.artifact.repository,R3_6_api_cleanup"/>
-<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.common,org.eclipse.equinox.p2.common,R3_6_api_cleanup"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.console,org.eclipse.equinox.p2.console,R3_6_api_cleanup"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core,org.eclipse.equinox.p2.core,R3_6_api_cleanup"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/incubator/p2/bundles/org.eclipse.equinox.p2.diagnostic,org.eclipse.equinox.p2.diagnostic,R3_6_api_cleanup"/>

Back to the top