Skip to content

Create multiple nodes when a node is created in GLSP editor #1419

Discussion options

You must be logged in to vote

In the meanwhile, I have looked at GCompartment for grouping nodes. Here's how I have done it.

protected createTaskNode(task: Task): GNode {
        // create compartment with two child nodes
        const compartment = GCompartment.builder().id(`${task.id}_compartment`).addCssClass('tasklist-compartment').layout('vbox');
        const child_node1 = GNode.builder()
            .id(`${task.id}_child1_id`)
            .addCssClass('tasklist-node')
            .add(GLabel.builder().text('child1').id(`${task.id}_child1_label`).build())
            .layout('hbox')
            .addLayoutOption('paddingLeft', 15)
            .position(0, 30)
            .size(100, 25)
            .build();

    …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tortmayr
Comment options

Answer selected by mshahzadiftikhar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants