public class ProvisioningUI extends Object
Constructor and Description |
---|
ProvisioningUI(ProvisioningSession session,
String profileId,
Policy policy)
Creates a new instance of the provisioning user interface.
|
Modifier and Type | Method and Description |
---|---|
static ProvisioningUI |
getDefaultUI()
Return the default ProvisioningUI.
|
InstallOperation |
getInstallOperation(Collection<IInstallableUnit> iusToInstall,
URI[] repositories)
Return an install operation that describes installing the specified IInstallableUnits from the
provided list of repositories.
|
LicenseManager |
getLicenseManager()
Return the license manager that should be used to remember
accepted user licenses.
|
org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner |
getOperationRunner()
This method is for automated testing only.
|
Policy |
getPolicy()
Return the UI policy used for this instance of the UI.
|
String |
getProfileId()
Return the profile id that should be assumed for this ProvisioningUI if no other
id is otherwise specified.
|
RepositoryTracker |
getRepositoryTracker()
Return the repository tracker that should be used to add, remove, and track the
statuses of known repositories.
|
ProvisioningSession |
getSession()
Return the provisioning session that should be used to obtain
provisioning services.
|
UninstallOperation |
getUninstallOperation(Collection<IInstallableUnit> iusToUninstall,
URI[] repositories)
Return an uninstall operation that describes uninstalling the specified IInstallableUnits, using
the supplied repositories to replace any metadata that must be retrieved for the uninstall.
|
UpdateOperation |
getUpdateOperation(Collection<IInstallableUnit> iusToUpdate,
URI[] repositories)
Return an update operation that describes updating the specified IInstallableUnits from the
provided list of repositories.
|
boolean |
hasScheduledOperations()
Return a boolean indicating whether the receiver has scheduled any operations
for the profile under management.
|
IArtifactRepository |
loadArtifactRepository(URI location,
boolean update,
IProgressMonitor monitor)
Load the specified artifact repository, signaling a repository operation start event
before loading, and a repository operation complete event after loading.
|
IMetadataRepository |
loadMetadataRepository(URI location,
boolean notify,
IProgressMonitor monitor)
Load the specified metadata repository, signaling a repository operation start event
before loading, and a repository operation complete event after loading.
|
void |
manageJob(Job job,
int jobRestartPolicy)
Manage the supplied job as a provisioning operation.
|
void |
manipulateRepositories(Shell shell)
Open a UI that allows the user to manipulate the repositories.
|
int |
openInstallWizard(Collection<IInstallableUnit> initialSelections,
InstallOperation operation,
LoadMetadataRepositoryJob job)
Open an install wizard for installing the specified IInstallableUnits
|
int |
openInstallWizard(Collection<IInstallableUnit> initialSelections,
InstallOperation operation,
RemediationOperation remediationOperation,
LoadMetadataRepositoryJob job)
Open an install wizard for installing the specified IInstallableUnits and remediationOperation.
|
int |
openUninstallWizard(Collection<IInstallableUnit> initialSelections,
UninstallOperation operation,
LoadMetadataRepositoryJob job)
Open an uninstall wizard for the specified uninstall operation.
|
int |
openUpdateWizard(boolean skipSelectionsPage,
UpdateOperation operation,
LoadMetadataRepositoryJob job)
Open an update wizard for the specified update operation.
|
int |
openUpdateWizard(boolean skipSelectionsPage,
UpdateOperation operation,
RemediationOperation remediationOperation,
LoadMetadataRepositoryJob job)
Open an update wizard for the specified update operation and remediationOperation.
|
void |
schedule(ProvisioningJob job,
int errorStyle)
Schedule a job to execute the supplied ProvisioningOperation.
|
void |
signalRepositoryOperationComplete(org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent event,
boolean update)
Signal that a repository operation has completed.
|
void |
signalRepositoryOperationStart()
Signal that a repository operation is about to begin.
|
public ProvisioningUI(ProvisioningSession session, String profileId, Policy policy)
session
- The current provisioning sessionprofileId
- The profile that this user interface is operating onpolicy
- The user interface policy settings to usepublic static ProvisioningUI getDefaultUI()
public Policy getPolicy()
null
public ProvisioningSession getSession()
null
public LicenseManager getLicenseManager()
null
if licenses are not
to be remembered.public RepositoryTracker getRepositoryTracker()
null
public String getProfileId()
public InstallOperation getInstallOperation(Collection<IInstallableUnit> iusToInstall, URI[] repositories)
iusToInstall
- the IInstallableUnits to be installedrepositories
- the repositories to use for the operationpublic UpdateOperation getUpdateOperation(Collection<IInstallableUnit> iusToUpdate, URI[] repositories)
iusToUpdate
- the IInstallableUnits to be updatedrepositories
- the repositories to use for the operationpublic UninstallOperation getUninstallOperation(Collection<IInstallableUnit> iusToUninstall, URI[] repositories)
iusToUninstall
- the IInstallableUnits to be installedrepositories
- the repositories to use for the operationpublic int openInstallWizard(Collection<IInstallableUnit> initialSelections, InstallOperation operation, LoadMetadataRepositoryJob job)
initialSelections
- the IInstallableUnits that should be selected when the wizard opens. May be null
.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.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.public int openInstallWizard(Collection<IInstallableUnit> initialSelections, InstallOperation operation, RemediationOperation remediationOperation, LoadMetadataRepositoryJob job)
initialSelections
- the IInstallableUnits that should be selected when the wizard opens. May be null
.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.remediationOperation
- the alternate operations if the proposed update failed. May be null
.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.RemediationOperation
public int openUpdateWizard(boolean skipSelectionsPage, UpdateOperation operation, LoadMetadataRepositoryJob job)
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.operation
- the operation describing the proposed update. Must not be null
.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.public int openUpdateWizard(boolean skipSelectionsPage, UpdateOperation operation, RemediationOperation remediationOperation, LoadMetadataRepositoryJob job)
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.operation
- the operation describing the proposed update. Must not be null
.remediationOperation
- the alternate operations if the proposed update failed. May be null
.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.public int openUninstallWizard(Collection<IInstallableUnit> initialSelections, UninstallOperation operation, LoadMetadataRepositoryJob job)
initialSelections
- the IInstallableUnits that should be selected when the wizard opens. May be null
.operation
- the operation describing the proposed uninstall. Must not be null
.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.public void manipulateRepositories(Shell shell)
shell
- the shell that should parent the UIpublic void schedule(ProvisioningJob job, int errorStyle)
job
- The operation to executeerrorStyle
- the flags passed to the StatusManager for error reportingpublic void manageJob(Job job, int jobRestartPolicy)
job
- the job to be managedjobRestartPolicy
- an integer constant specifying whether the
supplied job should cause a restart of the system. The UI Policy's
restart policy is used in conjunction with this constant to determine
what actually occurs when a job completes.ProvisioningJob.RESTART_NONE
,
ProvisioningJob.RESTART_ONLY
,
ProvisioningJob.RESTART_OR_APPLY
public boolean hasScheduledOperations()
true
if other provisioning operations have been scheduled,
false
if there are no operations scheduled.public org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner getOperationRunner()
public void signalRepositoryOperationStart()
public void signalRepositoryOperationComplete(org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent event, boolean update)
event
- a RepositoryEvent
that describes the overall operation. May be null
, which
indicates that there was no single event that can describe the operation.update
- true
if the event should be reflected in the UI, false if it should be ignored.public IMetadataRepository loadMetadataRepository(URI location, boolean notify, IProgressMonitor monitor) throws ProvisionException
location
- the location of the repositorynotify
- true
if the UI should be updated as a result of the load, false
if it should notmonitor
- the progress monitor to be usedProvisionException
- if the repository could not be loadedpublic IArtifactRepository loadArtifactRepository(URI location, boolean update, IProgressMonitor monitor) throws ProvisionException
location
- the location of the repositoryupdate
- true
if the UI should be updated as a result of the load, false
if it should notmonitor
- the progress monitor to be usedProvisionException
- if the repository could not be loaded
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.