public class ApplicationRestarterImpl implements ApplicationRestarter {
@Override
public void restart(final Boolean askBeforeRestart) {
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
if (app.isRestartCapable()) {
if (!askBeforeRestart || (userWantsToRestart())) {
app.restart();
}
} else {
if (!askBeforeRestart || (userWantsToShutdown())) {
app.exit(true);
}
}
}