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

13
LINES

< > BotCompany Repo | #1014047 // hBoolSelector

JavaX fragment (include)

1  
// params = relative link, HTML, relative link, HTML, ...
2  
static S hBoolSelector(bool value, S... params) {
3  
  new L<S> l;
4  
  for (int i = 0; i < l(params); i += 2) {
5  
    bool selected = value != (i == 0);
6  
    S link = params[i], html = params[i+1];
7  
    if (selected)
8  
      l.add(b("[" + html + "]"));
9  
    else
10  
      l.add(ahref(rawSelfLink(link), html));
11  
  }
12  
  ret join(" | ", l);
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1014047
Snippet name: hBoolSelector
Eternal ID of this version: #1014047/3
Text MD5: 199bdf154a6f08ac6b8587f93d6447fd
Author: stefan
Category: javax / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-03-25 16:03:09
Source code size: 395 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 389 / 433
Version history: 2 change(s)
Referenced in: [show references]