use of org.eclipse.equinox.p2.metadata.Version in project cubrid-manager by CUBRID.
the class UpdateHandler method doExecute.
protected void doExecute(LoadMetadataRepositoryJob job) {
if (isNoRepos) {
return;
}
UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
// check for updates
IStatus status = operation.resolveModal(null);
// AUTO check update and there is not update
if (isAutoCheckUpdate) {
// user cancelled
if (status.getSeverity() == IStatus.CANCEL) {
return;
}
// Special case those statuses where we would never want to open a wizard
if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
return;
}
// there is no plan, so we can't continue. Report any reason found
if (operation.getProvisioningPlan() == null && !status.isOK()) {
return;
}
}
if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation, getShell())) {
if (UpdateSingleIUWizard.validFor(operation)) {
// Special case for only updating a single root
UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(getProvisioningUI(), operation);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.create();
dialog.open();
} else {
// Open the normal version of the update wizard
getProvisioningUI().openUpdateWizard(false, operation, job);
}
}
}
use of org.eclipse.equinox.p2.metadata.Version in project yamcs-studio by yamcs.
the class UpdateHandler method doExecute.
@Override
protected void doExecute(LoadMetadataRepositoryJob job) {
if (hasNoRepos) {
MessageDialog.openInformation(null, "Update Yamcs Studio", "Could not check for updates since no repository is configured");
return;
}
UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
// check for updates
operation.resolveModal(null);
if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation, getShell())) {
if (UpdateSingleIUWizard.validFor(operation)) {
// Special case for only updating a single root
UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(getProvisioningUI(), operation);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.create();
dialog.open();
} else {
// Open the normal version of the update wizard
getProvisioningUI().openUpdateWizard(false, operation, job);
}
}
}
use of org.eclipse.equinox.p2.metadata.Version in project epp.mpc by eclipse.
the class ProfileChangeOperationComputer method pruneOlderVersions.
/**
* Remove ius from the given list where the current profile already contains a newer version of that iu.
*
* @param installableUnits
* @throws CoreException
*/
private void pruneOlderVersions(List<IInstallableUnit> installableUnits) throws CoreException {
if (!installableUnits.isEmpty()) {
Map<String, IInstallableUnit> iUsById = MarketplaceClientUi.computeInstalledIUsById(new NullProgressMonitor());
Iterator<IInstallableUnit> it = installableUnits.iterator();
while (it.hasNext()) {
IInstallableUnit iu = it.next();
IInstallableUnit installedIu = iUsById.get(iu.getId());
if (installedIu != null) {
Version installedVersion = installedIu.getVersion();
Version installableVersion = iu.getVersion();
if (installedVersion.compareTo(installableVersion) >= 0) {
it.remove();
}
}
}
if (installableUnits.isEmpty()) {
throw new CoreException(new Status(IStatus.INFO, MarketplaceClientUi.BUNDLE_ID, Messages.ProvisioningOperation_nothingToUpdate));
}
}
}
use of org.eclipse.equinox.p2.metadata.Version in project webtools.servertools by eclipse.
the class ExtensionUtility method addExtension.
private static void addExtension(List<IServerExtension> list, List<Extension> existing, IServerExtension newFeature, ExtensionListener listener) {
if (alreadyExists(existing, newFeature))
return;
synchronized (list) {
Version newV = newFeature.getVersion();
IServerExtension remove = null;
Iterator<IServerExtension> iterator = list.iterator();
while (iterator.hasNext()) {
IServerExtension feature = iterator.next();
if (feature.getId().equals(newFeature.getId())) {
if (newV == null)
// don't add if already exists
return;
if (feature.getVersion().compareTo(newV) < 0) {
remove = feature;
} else
// new feature is older
return;
}
}
if (remove != null) {
list.remove(remove);
if (listener != null)
listener.extensionRemoved((Extension) remove);
}
list.add(newFeature);
}
if (listener != null) {
listener.extensionFound((Extension) newFeature);
}
if (listener == null && newFeature instanceof ExtensionProxy)
serverExtension.add(createServerProxy((ExtensionProxy) newFeature));
}
use of org.eclipse.equinox.p2.metadata.Version in project tycho by eclipse.
the class P2ResolverAdditionalRequirementsTest method testNullVersionInTargetDefinitionUnit.
@Test
public void testNullVersionInTargetDefinitionUnit() throws Exception {
String nullVersion = null;
String arbitraryVersion = "2.5.8";
impl.addDependency(IU_TYPE, TARGET_UNIT_ID, nullVersion);
impl.addDependency(BUNDLE_TYPE, TARGET_UNIT_ID, nullVersion);
List<IRequirement> additionalRequirements = impl.getAdditionalRequirements();
IInstallableUnit iu = createIU(arbitraryVersion);
Assert.assertTrue("Given version was null; should be satisfied by any version", additionalRequirements.get(0).isMatch(iu));
Assert.assertTrue("Given version was null; should be satisfied by any version", additionalRequirements.get(1).isMatch(iu));
}
Aggregations