use of org.erlide.backend.runtimeinfo.RuntimeInfoPreferencesSerializer in project erlide_eclipse by erlang.
the class RuntimePreferencePage method performOk.
@Override
public boolean performOk() {
if (defaultRuntime == null || defaultRuntime == RuntimeInfo.NO_RUNTIME_INFO) {
defaultRuntime = (RuntimeInfo) fRuntimeList.getElementAt(0);
}
if (erlideRuntime == null) {
erlideRuntime = defaultRuntime;
}
boolean restart = false;
final RuntimeInfo oldDefault = catalog.getDefaultRuntime();
if (oldDefault != RuntimeInfo.NO_RUNTIME_INFO && !defaultRuntime.equals(oldDefault)) {
restart = RestartDialog.openQuestion(getShell());
}
catalog.setRuntimes(runtimes, defaultRuntime.getName(), erlideRuntime.getName());
final RuntimeInfoPreferencesSerializer serializer = new RuntimeInfoPreferencesSerializer();
serializer.store(new RuntimeInfoCatalogData(runtimes, defaultRuntime.getName(), erlideRuntime.getName()));
// save column widths
final IDialogSettings settings = ErlideUIPlugin.getDefault().getDialogSettings();
saveColumnSettings(settings, RuntimePreferencePage.RUNTIMES_PREFERENCE_PAGE);
if (restart) {
new UIJob("restart") {
@Override
public IStatus runInUIThread(final IProgressMonitor monitor) {
PlatformUI.getWorkbench().restart();
return Status.OK_STATUS;
}
}.schedule(100);
}
return super.performOk();
}
Aggregations