Skip to content

Commit 45b95a9

Browse files
committed
Added Group.children
1 parent af65daf commit 45b95a9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

reduxfx-view/src/main/java/com/netopyr/reduxfx/vscenegraph/builders/GroupBuilder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
public class GroupBuilder<B extends GroupBuilder<B>> extends ParentBuilder<B> {
1414

15+
private static final String CHILDREN = "children";
16+
1517
public GroupBuilder(Class<?> nodeClass,
1618
Map<String, Array<VNode>> childrenMap,
1719
Map<String, Option<VNode>> singleChildMap,
@@ -30,6 +32,12 @@ protected B create(
3032
return (B) new GroupBuilder<>(getNodeClass(), childrenMap, singleChildMap, properties, eventHandlers);
3133
}
3234

35+
public final B children(VNode... nodes) {
36+
return children(CHILDREN, nodes == null? Array.empty() : Array.of(nodes));
37+
}
38+
public final B children(Iterable<VNode> nodes) {
39+
return children(CHILDREN, nodes == null? Array.empty() : Array.ofAll(nodes));
40+
}
3341

3442
@Override
3543
public String toString() {

0 commit comments

Comments
 (0)