// we can get here through performApply, in that case only post one
// restart
if (restart && !restartPosted) {
if (getContainer() instanceof IWorkbenchPreferenceContainer) {
IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
UIJob job = new UIJob(WorkbenchMessages.ViewsPreference_restartRequestJobName) {
public IStatus runInUIThread(IProgressMonitor monitor) {
// make sure they really want to do this
int really = new MessageDialog(
null,
WorkbenchMessages.ViewsPreference_presentationConfirm_title,
null,
WorkbenchMessages.ViewsPreference_presentationConfirm_message,
MessageDialog.QUESTION,
new String[] {
WorkbenchMessages.ViewsPreference_presentationConfirm_yes,
WorkbenchMessages.ViewsPreference_presentationConfirm_no },
1).open();
if (really == Window.OK) {
PlatformUI.getWorkbench().restart();
}
return Status.OK_STATUS;
}
};
job.setSystem(true);
container.registerUpdateJob(job);
restartPosted = true;
}
}
return true;