use of org.eclipse.equinox.p2.core.ProvisionException in project tycho by eclipse.
the class P2MirrorDisablingArtifactRepositoryManager method loadRepository.
@Override
public IArtifactRepository loadRepository(URI location, int flags, IProgressMonitor monitor) throws ProvisionException {
IArtifactRepository repository = delegate.loadRepository(location, flags, monitor);
disableMirrors(repository, mavenLogger);
return repository;
}
use of org.eclipse.equinox.p2.core.ProvisionException in project tycho by eclipse.
the class P2MirrorDisablingArtifactRepositoryManager method refreshRepository.
@Override
public IArtifactRepository refreshRepository(URI location, IProgressMonitor monitor) throws ProvisionException {
IArtifactRepository repository = delegate.refreshRepository(location, monitor);
disableMirrors(repository, mavenLogger);
return repository;
}
use of org.eclipse.equinox.p2.core.ProvisionException in project epp.mpc by eclipse.
the class FeatureSelectionWizardPage method updateFeatures.
private void updateFeatures() {
SelectionModel selectionModel = getWizard().getSelectionModel();
Set<CatalogItem> allSelectionCatalogItems = selectionModel.getItemToSelectedOperation().keySet();
Set<CatalogItem> selectedCatalogItems = selectionModel.getSelectedCatalogItems();
if (allSelectionCatalogItems.isEmpty() || selectedCatalogItems.isEmpty()) {
showPreviousPage();
return;
}
viewer.setInput(selectionModel);
ResolveFeatureNamesOperation operation = new ResolveFeatureNamesOperation(new ArrayList<CatalogItem>(allSelectionCatalogItems)) {
Display display = getControl().getDisplay();
@Override
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
super.run(progressMonitor);
if (!display.isDisposed() && isActivePage()) {
display.asyncExec(new Runnable() {
public void run() {
if (isActivePage()) {
updateFeatureDescriptors(getFeatureDescriptors(), getUnresolvedFeatureDescriptors());
}
}
});
}
}
};
try {
getContainer().run(true, true, operation);
} catch (InvocationTargetException e) {
// we only log here since any error will also be displayed when resolving the provisioning operation.
int statusFlags = StatusManager.LOG;
IStatus status;
if (e.getCause() instanceof ProvisionException) {
status = ((ProvisionException) e.getCause()).getStatus();
} else {
status = MarketplaceClientCore.computeStatus(e, Messages.FeatureSelectionWizardPage_unexpectedException_verifyingFeatures);
statusFlags |= StatusManager.BLOCK | StatusManager.SHOW;
}
MarketplaceClientUi.handle(status, statusFlags);
} catch (InterruptedException e) {
// canceled
} finally {
if (!isActivePage()) {
return;
}
refresh();
// bug 470485: need to recompute button state, because run() resets that to previous state
refreshState();
}
// maybeUpdateProfileChangeOperation();
}
use of org.eclipse.equinox.p2.core.ProvisionException in project archi by archimatetool.
the class P2InstallHandler method execute.
public boolean execute(Shell shell) {
this.shell = shell;
IProgressMonitor monitor = new NullProgressMonitor();
if (!canWriteToInstallationFolder()) {
// $NON-NLS-1$
String message = Messages.P2InstallHandler_0 + " ";
if (PlatformUtils.isWindows()) {
message += Messages.P2InstallHandler_1;
} else {
message += Messages.P2InstallHandler_2;
}
displayErrorDialog(message);
return false;
}
List<File> files = askOpenFiles();
if (files.isEmpty()) {
return false;
}
List<IStatus> stats = new ArrayList<IStatus>();
try {
for (File file : files) {
IStatus status = installFile(file, monitor);
stats.add(status);
}
} catch (ProvisionException | IOException ex) {
displayErrorDialog(ex.getMessage());
return false;
}
// $NON-NLS-1$
String resultMessage = "";
boolean hasError = false;
for (int i = 0; i < stats.size(); i++) {
IStatus status = stats.get(i);
if (status.isOK()) {
needsRestart = true;
// $NON-NLS-1$
resultMessage += NLS.bind(Messages.P2InstallHandler_6 + "\n", files.get(i).getName());
} else {
hasError = true;
if (status.getCode() == 666) {
// $NON-NLS-1$
resultMessage += NLS.bind(Messages.P2InstallHandler_10 + "\n", files.get(i).getName());
} else if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
// $NON-NLS-1$
resultMessage += NLS.bind(Messages.P2InstallHandler_12 + "\n", files.get(i).getName());
} else {
// $NON-NLS-1$
resultMessage += NLS.bind(Messages.P2InstallHandler_14 + "\n", files.get(i).getName());
}
}
}
if (hasError) {
MessageDialog.openInformation(shell, Messages.P2InstallHandler_16, resultMessage);
}
return true;
}
use of org.eclipse.equinox.p2.core.ProvisionException in project archi by archimatetool.
the class P2Handler method install.
public IStatus install(URI uri, IProgressMonitor monitor) throws ProvisionException {
loadRepository(uri, monitor);
Collection<IInstallableUnit> toInstall = getGroupInstallableUnits(uri, monitor);
InstallOperation operation = new InstallOperation(getProvisioningSession(), toInstall);
return performOperation(operation, monitor);
}
Aggregations