@Override
public void quit() {
if (canQuit) {
super.quit();
} else {
final UIService uiService = getContext().getService(UIService.class);
if (uiService.isVisible()) {
UserInterface ui = uiService.getDefaultUI();
logService.info("Quit action: hide the application frame");
ui.getApplicationFrame().setVisible(false);
} else {
logService.info("Quit action: do nothing");
}