Search in sources :

Example 1 with IGraphMenuPlugin

use of com.google.security.zynamics.binnavi.API.plugins.IGraphMenuPlugin in project binnavi by google.

the class CGraphWindowMenuBar method dipose.

/**
   * Frees allocated resources.
   */
public void dipose() {
    m_synchronizer.dispose();
    m_selectionMenu.dispose();
    final List<IGraphMenuPlugin> plugins = Lists.newArrayList();
    for (final IPlugin<IPluginInterface> plugin : PluginInterface.instance().getPluginRegistry()) {
        if (plugin instanceof IGraphMenuPlugin) {
            plugins.add((IGraphMenuPlugin) plugin);
        }
    }
    for (final IGraphMenuPlugin plugin : plugins) {
        try {
            plugin.closed(m_model.getGraphFrame());
        } catch (final Exception exception) {
            CUtilityFunctions.logException(exception);
            final String innerMessage = "E00106: " + "Plugin caused an unexpected exception";
            final String innerDescription = CUtilityFunctions.createDescription(String.format("The plugin %s caused an unexpected exception.", plugin.getName()), new String[] { "The plugin contains a bug." }, new String[] { "The plugin probably behaves erroneously from this point on but it remains active" });
            NaviErrorDialog.show(m_model.getParent(), innerMessage, innerDescription, exception);
        }
    }
    m_pluginsMenu.dispose();
}
Also used : IPluginInterface(com.google.security.zynamics.binnavi.api2.IPluginInterface) IGraphMenuPlugin(com.google.security.zynamics.binnavi.API.plugins.IGraphMenuPlugin)

Example 2 with IGraphMenuPlugin

use of com.google.security.zynamics.binnavi.API.plugins.IGraphMenuPlugin in project binnavi by google.

the class CPluginsMenu method fillPluginsMenu.

/**
   * Creates the menu items of the Plugins menu.
   */
private void fillPluginsMenu() {
    final List<IGraphMenuPlugin> plugins = new ArrayList<IGraphMenuPlugin>();
    for (@SuppressWarnings("rawtypes") final IPlugin plugin : PluginInterface.instance().getPluginRegistry()) {
        if (plugin instanceof IGraphMenuPlugin) {
            plugins.add((IGraphMenuPlugin) plugin);
        }
    }
    add(CActionProxy.proxy(new CActionGraphScripting(m_model.getGraphPanel())));
    add(CActionProxy.proxy(new CActionOpenLogConsole()));
    addSeparator();
    for (final IGraphMenuPlugin plugin : plugins) {
        extendPluginMenu(plugin);
    }
}
Also used : CActionOpenLogConsole(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CActionOpenLogConsole) ArrayList(java.util.ArrayList) CActionGraphScripting(com.google.security.zynamics.binnavi.Gui.GraphWindows.Actions.CActionGraphScripting) IGraphMenuPlugin(com.google.security.zynamics.binnavi.API.plugins.IGraphMenuPlugin) IPlugin(com.google.security.zynamics.binnavi.api2.plugins.IPlugin)

Aggregations

IGraphMenuPlugin (com.google.security.zynamics.binnavi.API.plugins.IGraphMenuPlugin)2 CActionGraphScripting (com.google.security.zynamics.binnavi.Gui.GraphWindows.Actions.CActionGraphScripting)1 CActionOpenLogConsole (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CActionOpenLogConsole)1 IPluginInterface (com.google.security.zynamics.binnavi.api2.IPluginInterface)1 IPlugin (com.google.security.zynamics.binnavi.api2.plugins.IPlugin)1 ArrayList (java.util.ArrayList)1