SafeRunner.run(new SafeRunnable() {
/**
* Add the exception details to status is one happens.
*/
public void handleException(Throwable e) {
IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class);
statuses[0] = new Status(
IStatus.ERROR,
contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH,
IStatus.OK,
WorkbenchMessages.WorkbenchWizard_errorMessage,
e);
}
public void run() {
try {
workbenchWizard[0] = createWizard();
// create instance of target wizard
} catch (CoreException e) {
IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class);
statuses[0] = new Status(
IStatus.ERROR,
contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH,
IStatus.OK,
WorkbenchMessages.WorkbenchWizard_errorMessage,
e);
}
}