1 | svoid keepComponentsByPred(final Container container, final F1<Component, Bool> keep) swing { |
2 | bool changed = false; |
3 | if (container != null) for (int i = 0; i < numberOfChildren(container); i++) { |
4 | Component c = getComponentAtIndex(container, i); |
5 | if (!callF(keep, c)) { |
6 | container.remove(c); |
7 | set changed; |
8 | --i; |
9 | } |
10 | } |
11 | if (changed) revalidate(container); |
12 | } |
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: | 304 / 360 |
Version history: | 1 change(s) |
Referenced in: | [show references] |