Search in sources :

Example 1 with WindowMenu

use of jmri.util.WindowMenu in project JMRI by JMRI.

the class ManageLocationsFrame method addHelpMenu.

/**
     * Add a standard help menu, including window specific help item.
     *
     * @param ref    JHelp reference for the desired window-specific help page
     * @param direct true if the help menu goes directly to the help system,
     *               e.g. there are no items in the help menu
     *
     * WARNING: BORROWED FROM JmriJFrame.
     */
@Override
public void addHelpMenu(String ref, boolean direct) {
    // only works if no menu present?
    JMenuBar bar = getJMenuBar();
    if (bar == null) {
        bar = new JMenuBar();
    }
    // add Window menu
    // * GT 28-AUG-2008 Added window menu
    bar.add(new WindowMenu(this));
    // add Help menu
    jmri.util.HelpUtil.helpMenu(bar, ref, direct);
    setJMenuBar(bar);
}
Also used : WindowMenu(jmri.util.WindowMenu) JMenuBar(javax.swing.JMenuBar)

Example 2 with WindowMenu

use of jmri.util.WindowMenu in project JMRI by JMRI.

the class RosterFrame method systemsMenu.

protected void systemsMenu() {
    ActiveSystemsMenu.addItems(getMenu());
    getMenu().add(new WindowMenu(this));
}
Also used : WindowMenu(jmri.util.WindowMenu)

Example 3 with WindowMenu

use of jmri.util.WindowMenu in project JMRI by JMRI.

the class AppsLaunchFrame method createMenus.

/**
     * Add menus to a menu bar.
     * <P>
     * This does not include the development menu.
     *
     * @param menuBar the existing menu bar
     * @param wi      the WindowInterface to associate actions in menus with
     * @param pane    the JPanel to associate actions in menus with
     */
protected void createMenus(JMenuBar menuBar, WindowInterface wi, AppsLaunchPane pane) {
    // the debugging statements in the following are
    // for testing startup time
    log.debug("start building menus");
    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, pane);
    // * GT 28-AUG-2008 Added window menu
    menuBar.add(new WindowMenu(wi));
    helpMenu(menuBar, wi, pane);
    log.debug("end building menus");
}
Also used : WindowMenu(jmri.util.WindowMenu)

Example 4 with WindowMenu

use of jmri.util.WindowMenu 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");
}
Also used : QuitHandler(jmri.plaf.macosx.QuitHandler) WindowMenu(jmri.util.WindowMenu) EventObject(java.util.EventObject)

Example 5 with WindowMenu

use of jmri.util.WindowMenu in project JMRI by JMRI.

the class VSDManagerFrame method addHelpMenu.

/**
     * Add a standard help menu, including window specific help item.
     *
     * @param ref    JHelp reference for the desired window-specific help page
     * @param direct true if the help menu goes directly to the help system,
     *               e.g. there are no items in the help menu
     *
     * WARNING: BORROWED FROM JmriJFrame.
     */
@Override
public void addHelpMenu(String ref, boolean direct) {
    // only works if no menu present?
    JMenuBar bar = getJMenuBar();
    if (bar == null) {
        bar = new JMenuBar();
    }
    // add Window menu
    // * GT 28-AUG-2008 Added window menu
    bar.add(new WindowMenu(this));
    // add Help menu
    jmri.util.HelpUtil.helpMenu(bar, ref, direct);
    setJMenuBar(bar);
}
Also used : WindowMenu(jmri.util.WindowMenu) JMenuBar(javax.swing.JMenuBar)

Aggregations

WindowMenu (jmri.util.WindowMenu)6 JMenuBar (javax.swing.JMenuBar)3 EventObject (java.util.EventObject)1 QuitHandler (jmri.plaf.macosx.QuitHandler)1