Libraryless. Click here for Pure Java version (9216L/52K).
1 | // menuMaker = voidfunc(JPopupMenu) |
2 | static void internalFrameTitlePopupMenu(final JInternalFrame f, fO... params) {
|
3 | swing {
|
4 | O menuMaker; |
5 | if (l(params) == 1 && !(params[0] instanceof JMenu)) |
6 | menuMaker = params[0]; |
7 | else |
8 | menuMaker = voidfunc(JPopupMenu menu) { addMenuItems(menu, params) };
|
9 | |
10 | Component titleComponent = getInternalFrameTitlePaneComponent(f); |
11 | if (!titleComponent instanceof JComponent) |
12 | print("Can't add internal frame title popup menu!");
|
13 | else {
|
14 | componentPopupMenu((JComponent) titleComponent, menuMaker); |
15 | setOpt(componentPopupMenu_initForComponent((JComponent) titleComponent), internalFrameLeftButtonMagic := isTrue(vm_generalMap_get('internalFramePopupOnLeftButton)));
|
16 | } |
17 | |
18 | // Also add to the frame so we can show the items e.g. in a JFrame menu |
19 | componentPopupMenu(f, menuMaker); |
20 | } |
21 | } |
Began life as a copy of #1005777
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1015819 |
| Snippet name: | internalFrameTitlePopupMenu - add popup menu items to title bars (certain L&Fs only) |
| Eternal ID of this version: | #1015819/15 |
| Text MD5: | 9a74c1b8d438027de320a29a49ee0f31 |
| Transpilation MD5: | db9c10a127f81798de9ecbada45cc674 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-07-23 20:51:39 |
| Source code size: | 896 bytes / 21 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 854 / 1120 |
| Version history: | 14 change(s) |
| Referenced in: | [show references] |