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);
}
Aggregations