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

15
LINES

< > BotCompany Repo | #1019108 // replaceTreeNodeChildren_withDummyChild2 - add one level of children

JavaX fragment (include)

1  
static <A> bool replaceTreeNodeChildren_withDummyChild2(final DefaultMutableTreeNode node, fL<A> children, fO dummyChild, final F1<A, ? extends Collection<A>> makeChildren) {
2  
  if (node == null) false;
3  
  ret swing(func -> bool {
4  
    L oldChildren = mapMethod getUserObject(node.children());
5  
    if (eq(oldChildren, children)) false;
6  
    node.removeAllChildren();
7  
    for (A c : unnull(children)) {
8  
      DefaultMutableTreeNode node2 = new(c);
9  
      if (!empty(callF(makeChildren, c)))
10  
        node2.add(new DefaultMutableTreeNode(dummyChild));
11  
      node.add(node2);
12  
    }
13  
    true;
14  
  });
15  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019108
Snippet name: replaceTreeNodeChildren_withDummyChild2 - add one level of children
Eternal ID of this version: #1019108/3
Text MD5: 718c085b37a9aab4a19596eec21983c0
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-14 15:30:27
Source code size: 604 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 327 / 382
Version history: 2 change(s)
Referenced in: [show references]