null
.
+ * @param ius the IInstallableUnits for which licenses should be checked
+ * @param operation the provisioning operation describing what changes are to
+ * take place on the profile
+ */
+ public AcceptLicensesWizardPage(LicenseManager manager, IInstallableUnit[] ius, ProfileChangeOperation operation) {
+ super("AcceptLicenses"); //$NON-NLS-1$
+ setTitle("");
+ this.manager = manager;
+ update(ius, operation);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ }
+
+ void handleSelectionChanged(IStructuredSelection selection) {
+ if (!selection.isEmpty()) {
+ Object selected = selection.getFirstElement();
+ if (selected instanceof License)
+ licenseTextBox.setText(((License) selected).getBody());
+ else if (selected instanceof IUWithLicenseParent)
+ licenseTextBox.setText(((IUWithLicenseParent) selected).license.getBody());
+ }
+ }
+
+ /**
+ * The wizard is finishing. Perform any necessary processing.
+ *
+ * @return true
if the finish can proceed, false
if it
+ * should not.
+ */
+ public boolean performFinish() {
+ rememberAcceptedLicenses();
+ return true;
+ }
+
+ /**
+ * Return a boolean indicating whether there are licenses that must be accepted
+ * by the user.
+ *
+ * @return true
if there are licenses that must be accepted, and
+ * false
if there are no licenses that must be accepted.
+ */
+ public boolean hasLicensesToAccept() {
+ return licensesToIUs != null && licensesToIUs.size() > 0;
+ }
+
+ /**
+ * Update the current page to show the licenses that must be approved for the
+ * selected IUs and the provisioning plan.
+ *
+ * Clients using this page in conjunction with a {@link ProfileChangeOperation}
+ * should instead use
+ * {@link #update(IInstallableUnit[], ProfileChangeOperation)}. This method is
+ * intended for clients who are working with a low-level provisioning plan
+ * rather than an {@link InstallOperation} or {@link UpdateOperation}.
+ *
+ * @param theIUs the installable units to be installed for which licenses must
+ * be checked
+ * @param plan the provisioning plan that describes a resolved install
+ * operation
+ *
+ * @see #update(IInstallableUnit[], ProfileChangeOperation)
+ */
+
+ public void updateForPlan(IInstallableUnit[] theIUs, IProvisioningPlan plan) {
+ updateLicenses(theIUs, plan);
+ }
+
+ private void updateLicenses(IInstallableUnit[] theIUs, IProvisioningPlan plan) {
+ if (theIUs == null)
+ licensesToIUs = new HashMap<>();
+ else
+ findUnacceptedLicenses(theIUs, plan);
+ setDescription();
+ setPageComplete(licensesToIUs.size() == 0);
+ if (getControl() != null) {
+ Composite parent = getControl().getParent();
+ getControl().dispose();
+ iuViewer = null;
+ sashForm = null;
+ createControl(parent);
+ parent.layout(true);
+ }
+ }
+
+ /**
+ * Update the page for the specified IInstallableUnits and operation.
+ *
+ * @param theIUs the IInstallableUnits for which licenses should be checked
+ * @param operation the operation describing the pending profile change
+ */
+ public void update(IInstallableUnit[] theIUs, ProfileChangeOperation operation) {
+ if (operation != null && operation.hasResolved()) {
+ int sev = operation.getResolutionResult().getSeverity();
+ if (sev != IStatus.ERROR && sev != IStatus.CANCEL) {
+ updateLicenses(theIUs, operation.getProvisioningPlan());
+ } else {
+ updateLicenses(new IInstallableUnit[0], null);
+ }
+ }
+ }
+
+ private void findUnacceptedLicenses(IInstallableUnit[] selectedIUs, IProvisioningPlan plan) {
+ IInstallableUnit[] iusToCheck = selectedIUs;
+ if (plan != null) {
+ iusToCheck = plan.getAdditions().query(QueryUtil.createIUAnyQuery(), null).toArray(IInstallableUnit.class);
+ }
+
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=218532
+ // Current metadata generation can result with a feature group IU and the
+ // feature jar IU
+ // having the same name and license. We will weed out duplicates if the license
+ // and name are both
+ // the same.
+ licensesToIUs = new HashMap<>();// map of License->ArrayList of IUs with that license
+ HashMaptrue
if the license was recorded as accepted, false
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 true
if the license was recorded as rejected, false
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 true
if the license has previously been accepted,
+ * false
if it has not been accepted before.
+ *
+ */
+ public abstract boolean isAccepted(ILicense license);
+
+ /**
+ * Return a boolean indicating whether any licenses have been
+ * accepted.
+ *
+ * @return true
if accepted licenses have been recorded,
+ * false
if there have been no licenses accepted.
+
+ */
+ public abstract boolean hasAcceptedLicenses();
+}
diff --git a/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java
new file mode 100644
index 0000000000..36f5d7921a
--- /dev/null
+++ b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2009,2011 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.equinox.p2.ui;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.p2.operations.ProvisioningJob;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+/**
+ * A job that loads a set of metadata repositories and caches the loaded
+ * repositories. This job can be used when repositories are loaded by a client
+ * who wishes to maintain (and pass along) the in-memory references to the
+ * repositories. For example, repositories can be loaded in the background and
+ * then passed to another component, thus ensuring that the repositories remain
+ * loaded in memory.
+ *
+ * @since 2.0
+ * @noextend This class is not intended to be subclassed by clients.
+ */
+public class LoadMetadataRepositoryJob extends ProvisioningJob {
+
+ /**
+ * An object representing the family of jobs that load repositories.
+ */
+ public static final Object LOAD_FAMILY = new Object();
+
+ /**
+ * The key that should be used to set a property on a repository load job to
+ * indicate that authentication should be suppressed when loading the
+ * repositories.
+ */
+ public static final QualifiedName SUPPRESS_AUTHENTICATION_JOB_MARKER = new QualifiedName("",
+ "SUPPRESS_AUTHENTICATION_REQUESTS"); //$NON-NLS-1$
+
+ /**
+ * The key that should be used to set a property on a repository load job to
+ * indicate that repository events triggered by this job should be suppressed so
+ * that clients will ignore all events related to the load.
+ */
+ public static final QualifiedName SUPPRESS_REPOSITORY_EVENTS = new QualifiedName("", "SUPRESS_REPOSITORY_EVENTS"); //$NON-NLS-2$
+
+ /**
+ * The key that should be used to set a property on a repository load job to
+ * indicate that a wizard receiving this job needs to schedule it. In some
+ * cases, a load job is finished before invoking a wizard. In other cases, the
+ * job has not yet been scheduled so that listeners can be set up first.
+ */
+ public static final QualifiedName WIZARD_CLIENT_SHOULD_SCHEDULE = new QualifiedName("",
+ "WIZARD_CLIENT_SHOULD_SCHEDULE"); //$NON-NLS-1$
+
+ /**
+ * The key that should be used to set a property on a repository load job to
+ * indicate that load errors should be accumulated into a single status rather
+ * than reported as they occur.
+ */
+ public static final QualifiedName ACCUMULATE_LOAD_ERRORS = new QualifiedName("", "ACCUMULATE_LOAD_ERRORS"); //$NON-NLS-2$
+
+ private MultiStatus accumulatedStatus;
+ private ProvisioningUI ui;
+
+ /**
+ * Create a job that loads the metadata repositories known by the specified
+ * RepositoryTracker.
+ *
+ * @param ui the ProvisioningUI providing the necessary services
+ */
+ public LoadMetadataRepositoryJob(ProvisioningUI ui) {
+ super("", ui.getSession());
+ this.ui = ui;
+ }
+
+ @Override
+ public IStatus runModal(IProgressMonitor monitor) {
+ return Status.OK_STATUS;
+ }
+
+ protected boolean shouldAccumulateFailures() {
+ return getProperty(LoadMetadataRepositoryJob.ACCUMULATE_LOAD_ERRORS) != null;
+ }
+
+ /**
+ * Report the accumulated status for repository load failures. If there has been
+ * no status accumulated, or if the job has been cancelled, do not report
+ * anything. Detailed errors have already been logged.
+ */
+ public void reportAccumulatedStatus() {
+ IStatus status = getCurrentStatus();
+ if (status.isOK() || status.getSeverity() == IStatus.CANCEL)
+ return;
+
+ // If user is unaware of individual sites, nothing to report here.
+ if (!ui.getPolicy().getRepositoriesVisible())
+ return;
+ StatusManager.getManager().handle(status, StatusManager.SHOW);
+ // Reset the accumulated status so that next time we only report the newly not
+ // found repos.
+ accumulatedStatus = null;
+ }
+
+ private IStatus getCurrentStatus() {
+ if (accumulatedStatus != null) {
+ // If there is only missing repo to report, use the specific message rather than
+ // the generic.
+ if (accumulatedStatus.getChildren().length == 1)
+ return accumulatedStatus.getChildren()[0];
+ return accumulatedStatus;
+ }
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return family == LOAD_FAMILY;
+ }
+}
diff --git a/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/Policy.java b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/Policy.java
new file mode 100644
index 0000000000..e4eccabb6b
--- /dev/null
+++ b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/Policy.java
@@ -0,0 +1,509 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2012 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Ericsson AB (Hamdan Msheik) - Bug 396420 - Control Install dialog through preference customization
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
+import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * The Policy class is used to specify application specific policies that should
+ * be used in the standard p2 UI class libraries. The default policy is acquired
+ * using the OSGi service model.
+ *
+ * Policy allows clients to specify things such as how repositories are
+ * manipulated in the standard wizards and dialogs, and how the repositories or
+ * the installation itself should be traversed when displaying content.
+ *
+ * In some cases, the Policy is used only to define a default value that can be
+ * overridden by user choice and subsequently stored in dialog settings.
+ *
+ * Client applications should ensure that their Policy is registered before any
+ * of the p2 UI objects access the default Policy.
+ *
+ * @since 2.0
+ */
+public class Policy {
+
+ /**
+ * A constant indicating that restart should be forced (without confirmation)
+ * immediately after completion of a provisioning operation.
+ *
+ */
+ public static final int RESTART_POLICY_FORCE = 1;
+
+ /**
+ * A constant indicating that the changes should be applied dynamically to the
+ * profile (without confirmation) immediately after completion of a provisioning
+ * operation.
+ */
+ public static final int RESTART_POLICY_FORCE_APPLY = 2;
+
+ /**
+ * A constant indicating that the user should be prompted to restart after
+ * completion of a provisioning operation.
+ */
+ public static final int RESTART_POLICY_PROMPT = 3;
+
+ /**
+ * A constant indicating that, where possible, the user should be given the
+ * option to restart or dynamically apply the changes after completion of a
+ * provisioning operation.
+ */
+ public static final int RESTART_POLICY_PROMPT_RESTART_OR_APPLY = 4;
+
+ /**
+ * A constant indicating that the user should be presented with an update wizard
+ * that shows a list of IUs that can be updated. Even when only one update is
+ * available, a list showing the single update will be used. This option is
+ * recommended when the user's view of the system is a set of component updates
+ * and the user is expected to have knowledge of the composition of the system.
+ *
+ * @since 2.1
+ */
+ public static final int UPDATE_STYLE_MULTIPLE_IUS = 1;
+
+ /**
+ * A constant indicating that the user should be presented with an update wizard
+ * that shows detail about a single IU that can be updated. If more than one IU
+ * can be updated, the user will be shown a list; however, this option is
+ * recommended to be used only when the user's view of the system is a single
+ * application that can be updated, and only one IU is expected to be available
+ * for update.
+ *
+ * @since 2.1
+ */
+ public static final int UPDATE_STYLE_SINGLE_IUS = 2;
+
+ private IQuerytrue
if processing of the operation should continue,
+ * false
if not. It is up to the implementor to report any
+ * errors to the user when answering false
.
+ */
+ public boolean continueWorkingWithOperation(ProfileChangeOperation operation, Shell shell) {
+ return true;
+ }
+
+ /**
+ * Return a status that can be used to describe the failure to retrieve a
+ * profile.
+ *
+ * @return a status describing a failure to retrieve a profile, or
+ * null
if there is no such status.
+ */
+ public IStatus getNoProfileChosenStatus() {
+ return null;
+ }
+
+ /**
+ * Return a query that can be used to obtain the IInstallableUnits that should
+ * be presented to the user from the software repositories.
+ *
+ * @return the query used to retrieve user visible available IUs
+ */
+ public IQuerytrue
if repositories are visible to the end user,
+ * false
if they are not.
+ */
+ public boolean getRepositoriesVisible() {
+ return repositoriesVisible;
+ }
+
+ /**
+ * Set a boolean indicating whether the repositories should be visible to the
+ * user, such that the user can add, remove, and otherwise manipulate the
+ * software site list.
+ *
+ * @param visible true
if repositories are visible to the end user,
+ * false
if they are not.
+ */
+ public void setRepositoriesVisible(boolean visible) {
+ this.repositoriesVisible = visible;
+ }
+
+ /**
+ * Return a boolean indicating whether only the latest versions of updates and
+ * available software should be shown to the user.
+ *
+ * @return true
if only the latest versions are shown,
+ * false
if all versions should be shown.
+ */
+ public boolean getShowLatestVersionsOnly() {
+ return showLatestVersionsOnly;
+ }
+
+ /**
+ * Set a boolean indicating whether only the latest versions of updates and
+ * available software should be shown to the user.
+ *
+ * @param showLatest true
if only the latest versions are shown,
+ * false
if all versions should be shown.
+ */
+ public void setShowLatestVersionsOnly(boolean showLatest) {
+ this.showLatestVersionsOnly = showLatest;
+ }
+
+ /**
+ * Return a boolean indicating whether the user should be allowed drill down
+ * from a visible update or installed item into the requirements.
+ *
+ * @return true
if drilldown is allowed, false
if it
+ * is not.
+ */
+ public boolean getShowDrilldownRequirements() {
+ return allowDrilldown;
+ }
+
+ /**
+ * Set a boolean indicating whether the user should be allowed drill down from a
+ * visible update or installed item into the requirements.
+ *
+ * @param drilldown true
if drilldown is allowed,
+ * false
if it is not.
+ */
+ public void setShowDrilldownRequirements(boolean drilldown) {
+ this.allowDrilldown = drilldown;
+ }
+
+ /**
+ * Return a boolean value indicating whether or not the list of available
+ * software should be filtered based on the environment settings of the profile.
+ *
+ * @return true
if the results should be filtered and
+ * false
otherwise.
+ * @since 2.1
+ */
+ public boolean getFilterOnEnv() {
+ return filterOnEnv;
+ }
+
+ /**
+ * Set a boolean value indicating whether or not the list of available software
+ * should be filtered based on the environment settings of the profile.
+ *
+ * @param filterOnEnv true
if the results should be filtered and
+ * false
otherwise.
+ * @since 2.1
+ */
+ public void setFilterOnEnv(boolean filterOnEnv) {
+ this.filterOnEnv = filterOnEnv;
+ }
+
+ /**
+ * Return a boolean indicating whether available software should be grouped by
+ * category.
+ *
+ * @return true
if items should be grouped by category,
+ * false
if categories should not be shown.
+ */
+ public boolean getGroupByCategory() {
+ return groupByCategory;
+ }
+
+ /**
+ * Set a boolean indicating whether available software should be grouped by
+ * category.
+ *
+ * @param group true
if items should be grouped by category,
+ * false
if categories should not be shown.
+ */
+ public void setGroupByCategory(boolean group) {
+ this.groupByCategory = group;
+ }
+
+ /**
+ * Get the id of the preference page that should be used to link to the software
+ * sites page.
+ *
+ * @return the preference page id, or null
if there is no
+ * preference page id showing the software sites.
+ */
+ public String getRepositoryPreferencePageId() {
+ return repoPrefPageId;
+ }
+
+ /**
+ * Set the id of the preference page that should be used to link to the software
+ * sites page.
+ *
+ * @param id the preference page id, or null
if there is no
+ * preference page id showing the software sites.
+ */
+
+ public void setRepositoryPreferencePageId(String id) {
+ this.repoPrefPageId = id;
+ }
+
+ /**
+ * Get the localized name of the preference page that should be displayed in
+ * links to the software sites page.
+ *
+ * @return the preference page name, or null
if there is no
+ * preference page.
+ */
+ public String getRepositoryPreferencePageName() {
+ return repoPrefPageName;
+ }
+
+ /**
+ * Set the localized name of the preference page that should be displayed in
+ * links to the software sites page. This name is ignored if no id is specified
+ * for the preference page.
+ *
+ * @param name the preference page name, or null
if there is no
+ * preference page.
+ *
+ * @see Policy#setRepositoryPreferencePageId(String)
+ */
+
+ public void setRepositoryPreferencePageName(String name) {
+ this.repoPrefPageName = name;
+ }
+
+ /**
+ * Get the update wizard style that should be used to determine what to show the
+ * user when updates are available.
+ *
+ * @return an integer constant describing the update wizard style
+ *
+ * @see #UPDATE_STYLE_SINGLE_IUS
+ * @see #UPDATE_STYLE_MULTIPLE_IUS
+ *
+ * @since 2.1
+ */
+
+ public int getUpdateWizardStyle() {
+ return updateWizardStyle;
+ }
+
+ /**
+ * Get the update wizard style that should be used to determine what to show the
+ * user when updates are available.
+ *
+ * @param updateWizardStyle an integer constant describing the update wizard
+ * style
+ *
+ * @see #UPDATE_STYLE_SINGLE_IUS
+ * @see #UPDATE_STYLE_MULTIPLE_IUS
+ *
+ * @since 2.1
+ */
+
+ public void setUpdateWizardStyle(int updateWizardStyle) {
+ this.updateWizardStyle = updateWizardStyle;
+ }
+
+ /**
+ * Get a point describing the preferred size of the details area shown in single
+ * IU update wizards. This value may be null, in which case the wizard may
+ * compute a default size.
+ *
+ * @return a Point describing the preferred size of the update wizard details
+ * area.
+ *
+ * @see #UPDATE_STYLE_SINGLE_IUS
+ *
+ * @since 2.1
+ */
+
+ public Point getUpdateDetailsPreferredSize() {
+ return wizardDetailsPreferredSize;
+ }
+
+ /**
+ * Set the preferred size of the details area shown in update wizards which
+ * notify the user of a single update. Clients can use this value to ensure that
+ * their product's branded update notifier is sized to fit the expected content.
+ *
+ * @param preferredSize a Point describing the preferred size
+ *
+ * @see #UPDATE_STYLE_SINGLE_IUS
+ *
+ * @since 2.1
+ */
+
+ public void setUpdateDetailsPreferredSize(Point preferredSize) {
+ this.wizardDetailsPreferredSize = preferredSize;
+ }
+
+ /**
+ * Get a boolean value indicating whether to contact all sites.
+ *
+ * @return true
true if all sites need to be contacted,
+ * false
otherwise.
+ *
+ * @since 2.3
+ */
+ public boolean getContactAllSites() {
+ return this.contactAllSites;
+ }
+
+ /**
+ * Set a boolean indicating whether all sites need to be contacted.
+ *
+ * @param contactAll true
if all sites need to be contacted,
+ * false
otherwise.
+ *
+ * @since 2.3
+ */
+ public void setContactAllSites(boolean contactAll) {
+ this.contactAllSites = contactAll;
+ }
+
+ /**
+ * Get a boolean value indicating whether to hide already installed units.
+ *
+ * @return true
if already installed units are to be hidden,
+ * false
otherwise.
+ *
+ * @since 2.3
+ */
+ public boolean getHideAlreadyInstalled() {
+ return this.hideAlreadyInstalled;
+ }
+
+ /**
+ * Set a boolean indicating whether to hide already installed units.
+ *
+ * @param hide true
if already installed units need to be hidden,
+ * false
otherwise.
+ *
+ * @since 2.3
+ */
+ public void setHideAlreadyInstalled(boolean hide) {
+ this.hideAlreadyInstalled = hide;
+ }
+
+ /**
+ * Get a boolean value indicating whether the provisioning operation should
+ * check compatibility with current execution environment
+ *
+ * @return true
if operation should check compatibility with
+ * current execution environment, false
otherwise.
+ *
+ * @since 2.6
+ */
+ public boolean getCheckAgainstCurrentExecutionEnvironment() {
+ return this.checkAgainstCurrentExecutionEnvironment;
+ }
+
+ /**
+ * Set a boolean indicating whether the provisioning operation should check
+ * compatibility with current execution environment.
+ *
+ * @param check true
if operation should check compatibility with
+ * current execution environment, false
otherwise.
+ *
+ * @since 2.6
+ */
+ public void setCheckAgainstCurrentExecutionEnvironment(boolean check) {
+ this.checkAgainstCurrentExecutionEnvironment = check;
+ }
+}
diff --git a/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
new file mode 100644
index 0000000000..d918ccebd3
--- /dev/null
+++ b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
@@ -0,0 +1,403 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2018 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Sonatype, Inc. - ongoing development
+ * Red Hat Inc. - Bug 460967
+ ******************************************************************************/
+
+package org.eclipse.equinox.p2.ui;
+
+import java.net.URI;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner;
+import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.operations.*;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * ProvisioningUI defines the provisioning session, UI policy, and related
+ * services for a provisioning UI.
+ *
+ * @since 2.0
+ */
+public class ProvisioningUI {
+
+ /**
+ * Return the default ProvisioningUI.
+ *
+ * @return the default Provisioning UI.
+ */
+ public static ProvisioningUI getDefaultUI() {
+ return null;
+ }
+
+ private Policy policy;
+ private ProvisioningSession session;
+ private String profileId;
+
+ /**
+ * Creates a new instance of the provisioning user interface.
+ *
+ * @param session The current provisioning session
+ * @param profileId The profile that this user interface is operating on
+ * @param policy The user interface policy settings to use
+ */
+ public ProvisioningUI(ProvisioningSession session, String profileId, Policy policy) {
+ }
+
+ /**
+ * Return the UI policy used for this instance of the UI.
+ *
+ * @return the UI policy, must not be null
+ */
+ public Policy getPolicy() {
+ return policy;
+ }
+
+ /**
+ * Return the provisioning session that should be used to obtain provisioning
+ * services.
+ *
+ * @return the provisioning session, must not be null
+ */
+ public ProvisioningSession getSession() {
+ return session;
+ }
+
+ /**
+ * Return the license manager that should be used to remember accepted user
+ * licenses.
+ *
+ * @return the license manager. May be null
if licenses are not to
+ * be remembered.
+ */
+ public LicenseManager getLicenseManager() {
+ return null;
+ }
+
+ /**
+ * Return the repository tracker that should be used to add, remove, and track
+ * the statuses of known repositories.
+ *
+ * @return the repository tracker, must not be null
+ */
+ public RepositoryTracker getRepositoryTracker() {
+ return session.getProvisioningAgent().getService(RepositoryTracker.class);
+ }
+
+ /**
+ * Return the profile id that should be assumed for this ProvisioningUI if no
+ * other id is otherwise specified. Some UI classes are assigned a profile id,
+ * while others are not. For those classes that are not assigned a current
+ * profile id, this id can be used to obtain one.
+ *
+ * @return a profile id
+ */
+ public String getProfileId() {
+ return profileId;
+ }
+
+ /**
+ * Return an install operation that describes installing the specified
+ * IInstallableUnits from the provided list of repositories.
+ *
+ * @param iusToInstall the IInstallableUnits to be installed
+ * @param repositories the repositories to use for the operation
+ * @return the install operation
+ */
+ public InstallOperation getInstallOperation(Collectionnull
.
+ * @param operation the operation describing the proposed install. If
+ * this operation is not null
, then a
+ * wizard showing only the IInstallableUnits described
+ * in the operation will be shown. If the operation is
+ * null
, then a wizard allowing the user
+ * to browse the repositories will be opened.
+ * @param job a repository load job that is loading or has already
+ * loaded the repositories. Can be used to pass along
+ * an in-memory repository reference to the wizard.
+ *
+ * @return the wizard return code
+ */
+ public int openInstallWizard(Collectionnull
.
+ * @param operation the operation describing the proposed install. If
+ * this operation is not null
, then a
+ * wizard showing only the IInstallableUnits
+ * described in the operation will be shown. If the
+ * operation is null
, then a wizard
+ * allowing the user to browse the repositories will
+ * be opened.
+ * @param remediationOperation the alternate operations if the proposed update
+ * failed. May be null
.
+ * @param job a repository load job that is loading or has
+ * already loaded the repositories. Can be used to
+ * pass along an in-memory repository reference to
+ * the wizard.
+ *
+ * @return the wizard return code
+ * @see RemediationOperation
+ * @since 2.3
+ */
+ public int openInstallWizard(Collectiontrue
if the selection page should be
+ * skipped so that the user is viewing the resolution
+ * results. false
if the update selection
+ * page should be shown first.
+ * @param operation the operation describing the proposed update. Must
+ * not be null
.
+ * @param job a repository load job that is loading or has
+ * already loaded the repositories. Can be used to
+ * pass along an in-memory repository reference to the
+ * wizard.
+ *
+ * @return the wizard return code
+ */
+ public int openUpdateWizard(boolean skipSelectionsPage, UpdateOperation operation, LoadMetadataRepositoryJob job) {
+ return openUpdateWizard(skipSelectionsPage, operation, null, job);
+
+ }
+
+ /**
+ * Open an update wizard for the specified update operation and
+ * remediationOperation.
+ *
+ * @param skipSelectionsPage true
if the selection page should be
+ * skipped so that the user is viewing the
+ * resolution results. false
if the
+ * update selection page should be shown first.
+ * @param operation the operation describing the proposed update.
+ * Must not be null
.
+ * @param remediationOperation the alternate operations if the proposed update
+ * failed. May be null
.
+ * @param job a repository load job that is loading or has
+ * already loaded the repositories. Can be used to
+ * pass along an in-memory repository reference to
+ * the wizard.
+ *
+ * @return the wizard return code
+ * @since 2.3
+ */
+ public int openUpdateWizard(boolean skipSelectionsPage, UpdateOperation operation,
+ RemediationOperation remediationOperation, LoadMetadataRepositoryJob job) {
+ return 0;
+
+ }
+
+ /**
+ * Open an uninstall wizard for the specified uninstall operation.
+ *
+ * @param initialSelections the IInstallableUnits that should be selected when
+ * the wizard opens. May be null
.
+ * @param operation the operation describing the proposed uninstall.
+ * Must not be null
.
+ * @param job a repository load job that is loading or has already
+ * loaded the repositories. Can be used to pass along
+ * an in-memory repository reference to the wizard.
+ *
+ * @return the wizard return code
+ */
+ public int openUninstallWizard(Collectiontrue
if other provisioning operations have been
+ * scheduled, false
if there are no operations scheduled.
+ */
+ public boolean hasScheduledOperations() {
+ return getSession().hasScheduledOperationsFor(profileId);
+ }
+
+ /**
+ * This method is for automated testing only.
+ *
+ * @return the provisioning operation that can suppress restart for automated
+ * testing.
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public ProvisioningOperationRunner getOperationRunner() {
+ return null;
+ }
+
+ /**
+ * Signal that a repository operation is about to begin. This allows clients to
+ * ignore intermediate events until the operation is completed. Callers are
+ * responsible for ensuring that a corresponding operation ending event is
+ * signaled.
+ */
+ public void signalRepositoryOperationStart() {
+ }
+
+ /**
+ * Signal that a repository operation has completed.
+ *
+ * @param event a {@link RepositoryEvent} that describes the overall operation.
+ * May be null
, which indicates that there was no
+ * single event that can describe the operation.
+ * @param update true
if the event should be reflected in the UI,
+ * false if it should be ignored.
+ */
+ public void signalRepositoryOperationComplete(RepositoryEvent event, boolean update) {
+ }
+
+ /**
+ * Load the specified metadata repository, signaling a repository operation
+ * start event before loading, and a repository operation complete event after
+ * loading.
+ *
+ * @param location the location of the repository
+ * @param notify true
if the UI should be updated as a result of
+ * the load, false
if it should not
+ * @param monitor the progress monitor to be used
+ * @return the repository
+ * @throws ProvisionException if the repository could not be loaded
+ */
+
+ public IMetadataRepository loadMetadataRepository(URI location, boolean notify, IProgressMonitor monitor)
+ throws ProvisionException {
+ IMetadataRepository repo = null;
+ return repo;
+ }
+
+ /**
+ * Load the specified artifact repository, signaling a repository operation
+ * start event before loading, and a repository operation complete event after
+ * loading.
+ *
+ * @param location the location of the repository
+ * @param update true
if the UI should be updated as a result of
+ * the load, false
if it should not
+ * @param monitor the progress monitor to be used
+ * @return the repository
+ * @throws ProvisionException if the repository could not be loaded
+ */
+ public IArtifactRepository loadArtifactRepository(URI location, boolean update, IProgressMonitor monitor)
+ throws ProvisionException {
+ return null;
+ }
+}
diff --git a/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
new file mode 100644
index 0000000000..2aa1e5ae04
--- /dev/null
+++ b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2018 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Ericsson AB (Pascal Rapicault) - bug 398539
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ui;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * Page that allows users to update, add, remove, import, and export
+ * repositories. This page can be hosted inside a preference dialog or inside
+ * its own dialog.
+ *
+ * When hosting this page inside a non-preference dialog, some of the dialog
+ * methods will likely have to call page methods. The following snippet shows
+ * how to host this page inside a TitleAreaDialog.
+ *
+ * + * TitleAreaDialog dialog = new TitleAreaDialog(shell) { + * + * RepositoryManipulationPage page; + * + * protected Control createDialogArea(Composite parent) { + * page = new RepositoryManipulationPage(); + * page.setProvisioningUI(ProvisioningUI.getDefaultUI()); + * page.createControl(parent); + * this.setTitle("Software Sites"); + * this.setMessage("The enabled sites will be searched for software. Disabled sites are ignored."); + * return page.getControl(); + * } + * + * protected void okPressed() { + * if (page.performOk()) + * super.okPressed(); + * } + * + * protected void cancelPressed() { + * if (page.performCancel()) + * super.cancelPressed(); + * } + * }; + * dialog.open(); + *+ * + * @noextend This class is not intended to be subclassed by clients. + * + * @since 2.0 + */ +public class RepositoryManipulationPage extends PreferencePage implements IWorkbenchPreferencePage, ICopyable { + + @Override + public void copyToClipboard(Control activeControl) { + // TODO Auto-generated method stub + + } + + @Override + public void init(IWorkbench workbench) { + // TODO Auto-generated method stub + + } + + @Override + protected Control createContents(Composite parent) { + // TODO Auto-generated method stub + return null; + } + + /** + * Set the provisioning UI that provides the session, policy, and other services + * for the UI. This method must be called before the contents are created or it + * will have no effect. + * + * @param ui the provisioning UI to use for this page. + */ + public void setProvisioningUI(ProvisioningUI ui) { + } +} diff --git a/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RevertProfilePage.java b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RevertProfilePage.java new file mode 100644 index 0000000000..ae241846be --- /dev/null +++ b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RevertProfilePage.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2007, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.ui; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.about.InstallationPage; + +/** + * RevertProfilePage displays a profile's configuration history in an + * Installation Page. Clients can use this class as the implementation class for + * an installationPages extension. + * + * @see InstallationPage + * + * @noextend This class is not intended to be subclassed by clients. + * @noinstantiate This class is not intended to be instantiated by clients. + * @since 2.0 + * + */ +public class RevertProfilePage extends InstallationPage implements ICopyable { + + /** + * Set the provisioning UI to use with this page + * + * @param value the provisioning ui to use + * @since 2.1 + */ + public void setProvisioningUI(ProvisioningUI value) { + } + + @Override + public void createControl(Composite parent) { + // TODO Auto-generated method stub + + } + + @Override + public void copyToClipboard(Control activeControl) { + // TODO Auto-generated method stub + + } +} diff --git a/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html new file mode 100644 index 0000000000..ae652c5d04 --- /dev/null +++ b/tycho-its/projects/api-tools/missing-bin/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/package.html @@ -0,0 +1,38 @@ + + + + + + +
+This package consists of several kinds of classes:
+