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).

1  
static JComboBox jcomboboxFromConcepts_str(Class<? extends Concept> cc) {
2  
  ret jcomboboxFromConcepts_str(db_mainConcepts(), cc);
3  
}
4  
5  
static JComboBox jcomboboxFromConcepts_str(Concepts concepts, Class<? extends Concept> cc, Concept selected default null) {
6  
  L<S> items = ll("");
7  
  S selectedItem = null;
8  
  for (Concept c : list(concepts, cc)) {
9  
    S item = c.id + " - " + c;
10  
    if (c == selected) selectedItem = item;
11  
    items.add(item);
12  
  }
13  
  ret jcombobox(items, selectedItem);
14  
}

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: 233 / 334
Version history: 3 change(s)
Referenced in: [show references]