use of org.eclipse.jface.wizard.IWizardContainer 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);
}
use of org.eclipse.jface.wizard.IWizardContainer in project jbosstools-openshift by jbosstools.
the class AbstractOpenShiftWizardPage method initPageChangeListeners.
/**
* Sets this page to get informed of page changes before they occur and
* changes that occurred (if its running in WizardDialog).
*
* @see WizardDialog#addPageChangedListener(IPageChangedListener)
* @see WizardDialog#addPageChangingListener(IPageChangingListener)
*/
protected void initPageChangeListeners() {
IWizardContainer container = getContainer();
if (container instanceof WizardDialog) {
((WizardDialog) container).addPageChangedListener(onPageChanged());
((WizardDialog) container).addPageChangingListener(onPageChanging());
}
}
use of org.eclipse.jface.wizard.IWizardContainer in project gemoc-studio by eclipse.
the class OptionTemplateSection method resetPageState.
/**
* Resets the current page state by clearing the error message and making
* the page complete, thereby allowing users to flip to the next page.
*/
protected void resetPageState() {
if (pages.size() == 0)
return;
WizardPage firstPage = pages.get(0).page;
IWizardContainer container = firstPage.getWizard().getContainer();
WizardPage currentPage = (WizardPage) container.getCurrentPage();
currentPage.setErrorMessage(null);
currentPage.setPageComplete(true);
}
use of org.eclipse.jface.wizard.IWizardContainer in project gemoc-studio by eclipse.
the class TemplateListSelectionPage method setUseTemplate.
public void setUseTemplate(boolean useTemplate) {
fUseTemplate.setSelection(useTemplate);
wizardSelectionViewer.getControl().setEnabled(useTemplate);
if (!useTemplate)
// $NON-NLS-1$
setDescription("");
setDescriptionEnabled(useTemplate);
IWizardContainer container = getContainer();
if (container.getCurrentPage() != null) {
container.updateButtons();
}
}
Aggregations