1 | // see #1004681 |
2 | |
3 | static JTable showConcepts() { |
4 | final JTable table = tableWithToolTips(); |
5 | showFrame(tableWithSearcher(table)); |
6 | |
7 | tablePopupMenu(table, voidfunc(JPopupMenu menu, final int row) { |
8 | menu.add(jmenuitem("Delete", r { |
9 | Map map = getTableLineAsMap(table, row); |
10 | deleteConcept(toInt(map.get("ID"))); |
11 | })); |
12 | }); |
13 | |
14 | installTimer(table, 1000, 0, new Runnable { |
15 | long changesShown; |
16 | public void run() { |
17 | if (changesShown == changes) ret; |
18 | changesShown = changes; |
19 | L data = map(func(Concept c) { |
20 | litorderedmap("Name", joinLines(" / " , unnull(c.name)), /*"Energy", formatDouble(c.energy, 2),*/ "ID", c.id) |
21 | }, values(concepts)); |
22 | dataToTable_uneditable(table, data); |
23 | } |
24 | }); |
25 | |
26 | ret table; |
27 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004682 |
Snippet name: | showConcepts |
Eternal ID of this version: | #1004682/1 |
Text MD5: | bc83e74d4f07887b5d91089c12f49baf |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-09-02 17:21:04 |
Source code size: | 790 bytes / 27 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 564 / 516 |
Referenced in: | [show references] |