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)

static <A> bool replaceTreeNodeChildren_withDummyChild2(final DefaultMutableTreeNode node, fL<A> children, fO dummyChild, final F1<A, ? extends Collection<A>> makeChildren) {
  if (node == null) false;
  ret swing(func -> bool {
    L oldChildren = mapMethod getUserObject(node.children());
    if (eq(oldChildren, children)) false;
    node.removeAllChildren();
    for (A c : unnull(children)) {
      DefaultMutableTreeNode node2 = new(c);
      if (!empty(callF(makeChildren, c)))
        node2.add(new DefaultMutableTreeNode(dummyChild));
      node.add(node2);
    }
    true;
  });
}

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: 251 / 301
Version history: 2 change(s)
Referenced in: [show references]