Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1021497 // treePopupMenu

JavaX fragment (include)

1  
static <A> void treePopupMenu(final JTree tree, final VF2<JPopupMenu, A> fillMenu) {
2  
  componentPopupMenu2(tree, voidfunc(JTree tree, JPopupMenu menu) {
3  
    MouseEvent evt = componentPopupMenu_getEvent();
4  
    TreePath path = tree.getPathForLocation(evt.getX(), evt.getY());
5  
    if (path == null) ret;
6  
    DefaultMutableTreeNode node = cast path.getLastPathComponent();
7  
    tree.setSelectionPath(path);
8  
    A a = cast node.getUserObject();
9  
    callF(fillMenu, menu, a);
10  
  });
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021497
Snippet name: treePopupMenu
Eternal ID of this version: #1021497/3
Text MD5: d3b198cbfb0005a4bc8548aba654b95e
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-15 05:59:03
Source code size: 486 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 340 / 363
Version history: 2 change(s)
Referenced in: [show references]