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

12
LINES

< > BotCompany Repo | #1020898 - keepComponentsByPred

JavaX fragment (include)

svoid keepComponentsByPred(final Container container, final F1<Component, Bool> keep) swing {
  bool changed = false;
  if (container != null) for (int i = 0; i < numberOfChildren(container); i++) {
    Component c = getComponentAtIndex(container, i);
    if (!callF(keep, c)) {
      container.remove(c);
      set changed;
      --i;
    }
  }
  if (changed) revalidate(container);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020898
Snippet name: keepComponentsByPred
Eternal ID of this version: #1020898/2
Text MD5: 22d5ad393ea105e10ca2d2c83d450136
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-08 21:08:10
Source code size: 396 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 119 / 152
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1020898 & http://1020898.tinybrain.de