0

Write access for node from JComponent

Hello, I created a custom component with swing but I can't change properties of the corresponding concept (properties: isFinished : boolean)

component provider: (node, editorContext)->JComponent { 
  final JCheckBox check = new JCheckBox(); 
  check.addItemListener(new ItemListener() { 
    public void itemStateChanged(ItemEvent e) { 
      node.model/.getRepository().getModelAccess().runWriteAction({ => node.isFinished = check.isSelected(); }); 
    } 
  }); 
  check; 
}
prettyPrint();
The error message I get when clicking the checkbox is

IllegalModelChangeError: registered node can only be modified inside undoable command
or in 'loading' model [items]
prettyPrint();
How can I accomplish this? Thanks in advance.

22 comments

Please sign in to leave a comment.