use of org.eclipse.equinox.internal.p2.ui.dialogs.RemediationGroup in project epp.mpc by eclipse.
the class FeatureSelectionWizardPage method updateMessage.
void updateMessage() {
ProfileChangeOperation profileChangeOperation = getWizard().getProfileChangeOperation();
if (profileChangeOperation != null) {
if (profileChangeOperation instanceof RemediationOperation && ((RemediationOperation) profileChangeOperation).getResolutionResult() == Status.OK_STATUS) {
if (remediationGroup == null) {
remediationGroup = new RemediationGroup(this);
remediationGroup.createRemediationControl(container);
}
setMessage(remediationGroup.getMessage(), IStatus.WARNING);
remediationGroup.getDetailsGroup().setDetailText(getWizard().getErrorMessage());
remediationGroup.update((RemediationOperation) profileChangeOperation);
flipToRemediationComposite();
} else {
IStatus resolutionResult = profileChangeOperation.getResolutionResult();
if (!resolutionResult.isOK()) {
String message = resolutionResult.getMessage();
if (resolutionResult.getSeverity() == IStatus.ERROR) {
message = Messages.FeatureSelectionWizardPage_provisioningErrorAdvisory;
} else if (resolutionResult.getSeverity() == IStatus.WARNING) {
message = Messages.FeatureSelectionWizardPage_provisioningWarningAdvisory;
}
setMessage(message, Util.computeMessageType(resolutionResult));
// avoid gratuitous scrolling
String originalText = detailStatusText.getText();
String newText;
try {
newText = profileChangeOperation.getResolutionDetails();
} catch (Exception e) {
// sometimes p2 might throw an exception
MarketplaceClientUi.error(e);
newText = Messages.FeatureSelectionWizardPage_detailsUnavailable;
}
if (newText != originalText || (newText != null && !newText.equals(originalText))) {
detailStatusText.setText(newText);
}
((GridData) detailsControl.getLayoutData()).exclude = false;
} else {
setMessage(null, IMessageProvider.NONE);
((GridData) detailsControl.getLayoutData()).exclude = true;
}
}
} else {
setMessage(null, IMessageProvider.NONE);
((GridData) detailsControl.getLayoutData()).exclude = true;
}
((Composite) getControl()).layout(true);
defaultComposite.layout(true);
}
Aggregations