use of org.eclipse.equinox.internal.p2.ui.dialogs.UpdateSingleIUWizard 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.internal.p2.ui.dialogs.UpdateSingleIUWizard 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.internal.p2.ui.dialogs.UpdateSingleIUWizard in project knime-core by knime.
the class InvokeUpdateAction method openWizard.
@Override
protected void openWizard(final LoadMetadataRepositoryJob job, final ProvisioningUI provUI) {
final UpdateOperation operation = provUI.getUpdateOperation(null, null);
// check for updates
operation.resolveModal(null);
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
Shell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
if (!operation.hasResolved()) {
MessageDialog.openInformation(shell, "Update KNIME...", "No updates were found");
} else if (provUI.getPolicy().continueWorkingWithOperation(operation, shell)) {
if (UpdateSingleIUWizard.validFor(operation)) {
// Special case for only updating a single root
UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(provUI, operation);
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
if (dialog.open() == 0) {
clearOsgiAreaBeforeRestart();
}
} else {
// Open the normal version of the update wizard
if (provUI.openUpdateWizard(false, operation, job) == 0) {
clearOsgiAreaBeforeRestart();
}
}
}
}
});
}
Aggregations