use of jmri.plaf.macosx.PreferencesHandler in project JMRI by JMRI.
the class AppsLaunchFrame method editMenu.
protected void editMenu(JMenuBar menuBar, WindowInterface wi) {
JMenu editMenu = new JMenu(Bundle.getMessage("MenuEdit"));
menuBar.add(editMenu);
// cut, copy, paste
AbstractAction a;
a = new DefaultEditorKit.CutAction();
a.putValue(Action.NAME, Bundle.getMessage("MenuItemCut"));
editMenu.add(a);
a = new DefaultEditorKit.CopyAction();
a.putValue(Action.NAME, Bundle.getMessage("MenuItemCopy"));
editMenu.add(a);
a = new DefaultEditorKit.PasteAction();
a.putValue(Action.NAME, Bundle.getMessage("MenuItemPaste"));
editMenu.add(a);
// prefs
prefsAction = new apps.gui3.TabbedPreferencesAction(Bundle.getMessage("MenuItemPreferences"));
// Put prefs in Apple's prefered area on Mac OS X
if (SystemType.isMacOSX()) {
Application.getApplication().setPreferencesHandler(new PreferencesHandler() {
@Override
public void handlePreferences(EventObject eo) {
prefsAction.actionPerformed(null);
}
});
}
// Include prefs in Edit menu if not on Mac OS X or not using Aqua Look and Feel
if (!SystemType.isMacOSX() || !UIManager.getLookAndFeel().isNativeLookAndFeel()) {
editMenu.addSeparator();
editMenu.add(prefsAction);
}
}
use of jmri.plaf.macosx.PreferencesHandler in project JMRI by JMRI.
the class Apps method editMenu.
protected void editMenu(JMenuBar menuBar, WindowInterface wi) {
JMenu editMenu = new JMenu(Bundle.getMessage("MenuEdit"));
menuBar.add(editMenu);
// cut, copy, paste
AbstractAction a;
a = new DefaultEditorKit.CutAction();
a.putValue(Action.NAME, Bundle.getMessage("MenuItemCut"));
editMenu.add(a);
a = new DefaultEditorKit.CopyAction();
a.putValue(Action.NAME, Bundle.getMessage("MenuItemCopy"));
editMenu.add(a);
a = new DefaultEditorKit.PasteAction();
a.putValue(Action.NAME, Bundle.getMessage("MenuItemPaste"));
editMenu.add(a);
// prefs
prefsAction = new apps.gui3.TabbedPreferencesAction(Bundle.getMessage("MenuItemPreferences"));
// Put prefs in Apple's prefered area on Mac OS X
if (SystemType.isMacOSX()) {
Application.getApplication().setPreferencesHandler(new PreferencesHandler() {
@Override
public void handlePreferences(EventObject eo) {
doPreferences();
}
});
}
// Include prefs in Edit menu if not on Mac OS X or not using Aqua Look and Feel
if (!SystemType.isMacOSX() || !UIManager.getLookAndFeel().isNativeLookAndFeel()) {
editMenu.addSeparator();
editMenu.add(prefsAction);
}
}
use of jmri.plaf.macosx.PreferencesHandler 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