Search in sources :

Example 1 with AddMenuItemToGMGenToolsMenuMessage

use of gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage in project pcgen by PCGen.

the class GMGenSystem method handleMessage.

/**
     * Message handler for the GMBus.
     * 
     * @param message
     *            The message passed in from the bus
     */
@Override
public void handleMessage(PCGenMessage message) {
    // A plugin is asking for the creation of a new tab
    if (message instanceof RequestAddTabToGMGenMessage) {
        RequestAddTabToGMGenMessage tmessage = (RequestAddTabToGMGenMessage) message;
        Logging.debugPrint("Creating Tab " + GMGenSystemView.getTabPane().getTabCount());
        theView.insertPane(tmessage.getName(), tmessage.getPane(), GMGenSystemView.getTabPane().getTabCount());
    } else if (message instanceof RequestAddPreferencesPanelMessage) {
        RequestAddPreferencesPanelMessage pmessage = (RequestAddPreferencesPanelMessage) message;
        Logging.debugPrint("Creating Preferences Panel");
        rootNode.addPanel(pmessage.getName(), pmessage.getPrefsPanel());
    } else // A plugin is asking for the creation of a new option in the tool menu
    if (message instanceof AddMenuItemToGMGenToolsMenuMessage) {
        AddMenuItemToGMGenToolsMenuMessage mmessage = (AddMenuItemToGMGenToolsMenuMessage) message;
        toolsMenu.add(mmessage.getMenuItem());
    } else if (message instanceof GMGenBeingClosedMessage) {
        setCloseSettings();
        // Karianna 07/03/2008 - Added a call to exitForm passing in no
        // window event
        // TODO This sequence of calls simply hides GMGen as opposed to
        // unloading it
        exitForm(null);
    }
}
Also used : RequestAddTabToGMGenMessage(gmgen.pluginmgr.messages.RequestAddTabToGMGenMessage) AddMenuItemToGMGenToolsMenuMessage(gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage) RequestAddPreferencesPanelMessage(gmgen.pluginmgr.messages.RequestAddPreferencesPanelMessage) GMGenBeingClosedMessage(gmgen.pluginmgr.messages.GMGenBeingClosedMessage)

Example 2 with AddMenuItemToGMGenToolsMenuMessage

use of gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage in project pcgen by PCGen.

the class InitiativePlugin method initMenus.

/**
	 * <p>
	 * Initializes the menus.
	 * </p>
	 */
private void initMenus() {
    initToolsItem.setMnemonic('I');
    initToolsItem.setText("Initiative");
    initToolsItem.addActionListener(this::initMenuItem);
    messageHandler.handleMessage(new AddMenuItemToGMGenToolsMenuMessage(this, initToolsItem));
}
Also used : AddMenuItemToGMGenToolsMenuMessage(gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage)

Example 3 with AddMenuItemToGMGenToolsMenuMessage

use of gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage in project pcgen by PCGen.

the class EncounterPlugin method initMenus.

/**
	 * Initiliase the menus
	 */
public void initMenus() {
    encounterToolsItem.setMnemonic(LanguageBundle.getMnemonic(IN_NAME_MN));
    encounterToolsItem.setText(getLocalizedName());
    encounterToolsItem.addActionListener(EncounterPlugin::toolMenuItem);
    messageHandler.handleMessage(new AddMenuItemToGMGenToolsMenuMessage(this, encounterToolsItem));
}
Also used : AddMenuItemToGMGenToolsMenuMessage(gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage)

Example 4 with AddMenuItemToGMGenToolsMenuMessage

use of gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage in project pcgen by PCGen.

the class NotesPlugin method initMenus.

/** Initializes the Menus on the menu bar */
private void initMenus() {
    //$NON-NLS-1$
    notesToolsItem.setMnemonic(LanguageBundle.getMnemonic("in_mn_plugin_notes_name"));
    notesToolsItem.setText(getLocalizedName());
    notesToolsItem.addActionListener(NotesPlugin::toolMenuItem);
    messageHandler.handleMessage(new AddMenuItemToGMGenToolsMenuMessage(this, notesToolsItem));
}
Also used : AddMenuItemToGMGenToolsMenuMessage(gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage)

Example 5 with AddMenuItemToGMGenToolsMenuMessage

use of gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage in project pcgen by PCGen.

the class PCGTrackerPlugin method initMenus.

private void initMenus() {
    //$NON-NLS-1$
    charToolsItem.setMnemonic(LanguageBundle.getMnemonic("in_mn_plugin_pcgtracker_name"));
    //$NON-NLS-1$
    charToolsItem.setText(LanguageBundle.getString("in_plugin_pcgtracker_name"));
    charToolsItem.addActionListener(PCGTrackerPlugin::toolMenuItem);
    messageHandler.handleMessage(new AddMenuItemToGMGenToolsMenuMessage(this, charToolsItem));
}
Also used : AddMenuItemToGMGenToolsMenuMessage(gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage)

Aggregations

AddMenuItemToGMGenToolsMenuMessage (gmgen.pluginmgr.messages.AddMenuItemToGMGenToolsMenuMessage)9 GMGenBeingClosedMessage (gmgen.pluginmgr.messages.GMGenBeingClosedMessage)1 RequestAddPreferencesPanelMessage (gmgen.pluginmgr.messages.RequestAddPreferencesPanelMessage)1 RequestAddTabToGMGenMessage (gmgen.pluginmgr.messages.RequestAddTabToGMGenMessage)1