Libraryless. Click here for Pure Java version (12821L/87K).
1 | // field: field to use for display |
2 | static JComboBox jcomboboxFromConcepts(Class<? extends Concept> cc, S field) { |
3 | ret jcomboboxFromConcepts(mainConcepts, cc, field); |
4 | } |
5 | |
6 | static JComboBox jcomboboxFromConcepts(Concepts concepts, Class<? extends Concept> cc, S field) { |
7 | L<S> items = ll(""); |
8 | for (Concept c : list(concepts, cc)) { |
9 | S name = ""; |
10 | pcall { if (nempty(field)) name = str(cget(c, field)); } |
11 | items.add(c.id + addPrefixIfNotEmpty(" - ", name)); |
12 | } |
13 | ret jcombobox(items); |
14 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1006615 |
Snippet name: | jcomboboxFromConcepts |
Eternal ID of this version: | #1006615/2 |
Text MD5: | c1ea5b94f000d7ce3fbd4e53b7b019f9 |
Transpilation MD5: | 6cbd4d794f7f5b4096adb308f6b87899 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-06 23:48:10 |
Source code size: | 509 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 553 / 607 |
Version history: | 1 change(s) |
Referenced in: | [show references] |