Search in sources :

Example 1 with CAddAddressSpaceAction

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CAddAddressSpaceAction in project binnavi by google.

the class CProjectNodeMenuBuilder method createMenu.

@Override
protected void createMenu(final JComponent menu) {
    if ((m_projects.length == 1) && (m_addAddressSpaceAction == null)) {
        // We delay the creation of the m_addAddressSpaceAction object because we need to have
        // getSelectionUpdater working.
        final INaviProject singleProject = m_projects[0];
        m_addAddressSpaceAction = CActionProxy.proxy(new CAddAddressSpaceAction(getProjectTree(), singleProject, getSelectionUpdater()));
        updateActions(singleProject);
    }
    final boolean isSingleSelection = m_projects.length == 1;
    if (canOpen()) {
        menu.add(new JMenuItem(m_loadProjectAction));
        menu.add(new JSeparator());
    }
    if (isSingleSelection) {
        // We can not search in more than one project at a time, and only if the project
        // is already loaded.
        menu.add(new JMenuItem(m_searchViewAction));
        menu.add(new JSeparator());
        // We do not allow the user to add address spaces to more than one
        // project at a time. And the project must be loaded too.
        menu.add(new JMenuItem(m_addAddressSpaceAction));
        menu.add(new JSeparator());
        menu.add(new JMenuItem(m_forwardAction));
        menu.add(new JSeparator());
    }
    menu.add(new JMenuItem(CActionProxy.proxy(new CDeleteProjectAction(getParent(), m_database, m_projects, getParentUpdater()))));
    if (m_table != null) {
        menu.add(new JSeparator());
        menu.add(new JMenuItem(CActionProxy.proxy(new CSearchTableAction(getParent(), m_table))));
        menu.add(new JMenuItem(CActionProxy.proxy(new CopySelectionAction(m_table))));
    }
    addPluginMenus(menu);
}
Also used : INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) CopySelectionAction(com.google.security.zynamics.zylib.gui.tables.CopySelectionAction) CAddAddressSpaceAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CAddAddressSpaceAction) CDeleteProjectAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CDeleteProjectAction) JMenuItem(javax.swing.JMenuItem) CSearchTableAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CSearchTableAction) JSeparator(javax.swing.JSeparator)

Aggregations

CAddAddressSpaceAction (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CAddAddressSpaceAction)1 CDeleteProjectAction (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CDeleteProjectAction)1 CSearchTableAction (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CSearchTableAction)1 INaviProject (com.google.security.zynamics.binnavi.disassembly.INaviProject)1 CopySelectionAction (com.google.security.zynamics.zylib.gui.tables.CopySelectionAction)1 JMenuItem (javax.swing.JMenuItem)1 JSeparator (javax.swing.JSeparator)1