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

14
LINES

< > BotCompany Repo | #1028041 // jcomboboxFromConcepts_str - use concept's toString

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (12827L/87K).

static JComboBox jcomboboxFromConcepts_str(Class<? extends Concept> cc) {
  ret jcomboboxFromConcepts_str(db_mainConcepts(), cc);
}

static JComboBox jcomboboxFromConcepts_str(Concepts concepts, Class<? extends Concept> cc, Concept selected default null) {
  L<S> items = ll("");
  S selectedItem = null;
  for (Concept c : list(concepts, cc)) {
    S item = c.id + " - " + c;
    if (c == selected) selectedItem = item;
    items.add(item);
  }
  ret jcombobox(items, selectedItem);
}

Author comment

Began life as a copy of #1006615

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1028041
Snippet name: jcomboboxFromConcepts_str - use concept's toString
Eternal ID of this version: #1028041/4
Text MD5: bd920f301a58a01235a459f11f64a222
Transpilation MD5: 2804a76f98134d6bfbd1f597e1c72743
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-07 00:10:23
Source code size: 498 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 231 / 331
Version history: 3 change(s)
Referenced in: [show references]