use of org.eclipse.equinox.p2.operations.UninstallOperation in project epp.mpc by eclipse.
the class MarketplaceWizard method getNextPage.
IWizardPage getNextPage(IWizardPage page, boolean nextpressed) {
boolean skipFeatureSelection = false;
MarketplacePage catalogPage = getCatalogPage();
if (page == catalogPage && nextpressed) {
profileChangeOperation = null;
featureSelectionWizardPage.updateMessage();
if (catalogPage.canSkipFeatureSelection()) {
skipFeatureSelection = true;
}
}
if (page == featureSelectionWizardPage || (page == catalogPage && skipFeatureSelection)) {
IWizardContainer container = getContainer();
if (nextpressed && profileChangeOperation != null && profileChangeOperation instanceof RemediationOperation) {
try {
container.run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
((RemediationOperation) profileChangeOperation).setCurrentRemedy(featureSelectionWizardPage.getRemediationGroup().getCurrentRemedy());
profileChangeOperation.resolveModal(monitor);
}
});
} catch (InterruptedException e) {
// Nothing to report if thread was interrupted
} catch (InvocationTargetException e) {
ProvUI.handleException(e.getCause(), null, StatusManager.SHOW | StatusManager.LOG);
}
}
IWizardPage nextPage = null;
boolean operationUpdated = false;
if (profileChangeOperation == null) {
if (nextpressed) {
updateProfileChangeOperation();
operationUpdated = true;
}
if (profileChangeOperation == null || !profileChangeOperation.getResolutionResult().isOK()) {
// can't compute a change operation, so there must be some kind of error
// we show these on the the feature selection wizard page
nextPage = featureSelectionWizardPage;
} else if (profileChangeOperation instanceof UninstallOperation) {
// next button was used to resolve errors on an uninstall.
// by returning the same page the finish button will be enabled, allowing the user to finish.
nextPage = featureSelectionWizardPage;
} else if (profileChangeOperation instanceof RemediationOperation) {
nextPage = featureSelectionWizardPage;
}
}
if (nextPage == null && nextpressed && profileChangeOperation instanceof RemediationOperation && !featureSelectionWizardPage.isInRemediationMode()) {
featureSelectionWizardPage.flipToRemediationComposite();
nextPage = featureSelectionWizardPage;
}
if (nextPage == null && computeMustCheckLicenseAcceptance()) {
if (acceptLicensesPage == null) {
acceptLicensesPage = new AcceptLicensesWizardPage(ProvisioningUI.getDefaultUI().getLicenseManager(), operationIUs, profileChangeOperation);
addPage(acceptLicensesPage);
} else {
acceptLicensesPage.update(operationIUs, profileChangeOperation);
}
if (nextpressed || acceptLicensesPage.hasLicensesToAccept() || profileChangeOperation instanceof RemediationOperation) {
nextPage = acceptLicensesPage;
}
}
if (nextPage == null && page == catalogPage) {
nextPage = featureSelectionWizardPage;
}
if (operationUpdated && nextPage == container.getCurrentPage()) {
container.updateButtons();
}
return nextPage;
}
if (page instanceof ImportFavoritesPage) {
return catalogPage;
}
return getNextPageInList(page);
}
Aggregations