use of jmri.plaf.macosx.QuitHandler in project JMRI by JMRI.
the class Apps method createMenus.
/**
* Create default menubar.
* <P>
* This does not include the development menu.
*
* @param menuBar Menu bar to be populated
* @param wi WindowInterface where this menu bar will appear
*/
protected void createMenus(JMenuBar menuBar, WindowInterface wi) {
// the debugging statements in the following are
// for testing startup time
log.debug("start building menus");
if (SystemType.isMacOSX()) {
Application.getApplication().setQuitHandler(new QuitHandler() {
@Override
public boolean handleQuitRequest(EventObject eo) {
return handleQuit();
}
});
}
fileMenu(menuBar, wi);
editMenu(menuBar, wi);
toolsMenu(menuBar, wi);
rosterMenu(menuBar, wi);
panelMenu(menuBar, wi);
// check to see if operations in main menu
if (jmri.jmrit.operations.setup.Setup.isMainMenuEnabled()) {
operationsMenu(menuBar, wi);
}
systemsMenu(menuBar, wi);
scriptMenu(menuBar, wi);
debugMenu(menuBar, wi);
// * GT 28-AUG-2008 Added window menu
menuBar.add(new WindowMenu(wi));
helpMenu(menuBar, wi);
log.debug("end building menus");
}
use of jmri.plaf.macosx.QuitHandler in project JMRI by JMRI.
the class Apps3 method initMacOSXMenus.
protected void initMacOSXMenus() {
jmri.plaf.macosx.Application macApp = jmri.plaf.macosx.Application.getApplication();
macApp.setAboutHandler(new AboutHandler() {
@Override
public void handleAbout(EventObject eo) {
new AboutDialog(null, true).setVisible(true);
}
});
macApp.setPreferencesHandler(new PreferencesHandler() {
@Override
public void handlePreferences(EventObject eo) {
new TabbedPreferencesAction(Bundle.getMessage("MenuItemPreferences")).actionPerformed();
}
});
macApp.setQuitHandler(new QuitHandler() {
@Override
public boolean handleQuitRequest(EventObject eo) {
return handleQuit();
}
});
}
Aggregations