Search in sources :

Example 1 with ITagTreeNode

use of com.google.security.zynamics.binnavi.Gui.GraphWindows.NodeTaggingTree.Nodes.ITagTreeNode in project binnavi by google.

the class CTagsTree method showPopupMenu.

/**
   * Shows the context menu for a given mouse event.
   *
   * @param event The mouse event that triggered the popup menu.
   */
private void showPopupMenu(final MouseEvent event) {
    final ITagTreeNode selectedNode = (ITagTreeNode) TreeHelpers.getNodeAt(this, event.getX(), event.getY());
    if (selectedNode == null) {
        // Show the default menu
        final JPopupMenu popupMenu = new JPopupMenu();
        popupMenu.add(CActionProxy.proxy(new CAddRootTagNodeAction(m_parent, m_tagManager, m_rootNode.getTag())));
        popupMenu.show(this, event.getX(), event.getY());
    } else {
        final JPopupMenu menu = selectedNode.getPopupMenu();
        if (menu != null) {
            menu.show(this, event.getX(), event.getY());
        }
    }
}
Also used : CAddRootTagNodeAction(com.google.security.zynamics.binnavi.Gui.GraphWindows.NodeTaggingTree.Actions.CAddRootTagNodeAction) ITagTreeNode(com.google.security.zynamics.binnavi.Gui.GraphWindows.NodeTaggingTree.Nodes.ITagTreeNode) JPopupMenu(javax.swing.JPopupMenu)

Aggregations

CAddRootTagNodeAction (com.google.security.zynamics.binnavi.Gui.GraphWindows.NodeTaggingTree.Actions.CAddRootTagNodeAction)1 ITagTreeNode (com.google.security.zynamics.binnavi.Gui.GraphWindows.NodeTaggingTree.Nodes.ITagTreeNode)1 JPopupMenu (javax.swing.JPopupMenu)1