Search in sources :

Example 1 with CDeleteBookmarkAction

use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.Actions.CDeleteBookmarkAction in project binnavi by google.

the class CCodeBookmarkTable method showPopup.

/**
   * Shows a context menu.
   *
   * @param event Mouse-event that triggered the context menu.
   */
private void showPopup(final MouseEvent event) {
    int[] rows = getSelectedRows();
    // where the click happened.
    if ((rows.length == 0) || (rows.length == 1)) {
        final int row = rowAtPoint(event.getPoint());
        final int column = columnAtPoint(event.getPoint());
        // Apparently no row was properly hit
        if ((row == -1) || (column == -1)) {
            return;
        }
        changeSelection(row, column, false, false);
        rows = getSelectedRows();
    }
    final JPopupMenu menu = new JPopupMenu();
    menu.add(new JMenuItem(CActionProxy.proxy(new CDeleteBookmarkAction(m_bookmarkManager, rows))));
    menu.show(event.getComponent(), event.getX(), event.getY());
}
Also used : CDeleteBookmarkAction(com.google.security.zynamics.binnavi.Gui.CodeBookmarks.Actions.CDeleteBookmarkAction) JMenuItem(javax.swing.JMenuItem) JPopupMenu(javax.swing.JPopupMenu)

Aggregations

CDeleteBookmarkAction (com.google.security.zynamics.binnavi.Gui.CodeBookmarks.Actions.CDeleteBookmarkAction)1 JMenuItem (javax.swing.JMenuItem)1 JPopupMenu (javax.swing.JPopupMenu)1