Model access in Swing Component Action

Hello forum!

I'm using a swing component (JCheckBox) in the editor aspect. If the user clicks on the checkbox I would like to change a property from my concept. Unfortunately the ModelAccess is deprecated. What can I use instead?


final JCheckBox cb=new JCheckBox("CheckBox");
ActionListener actionListener = newActionListener(){
@Override
public void actionPerformed(ActionEvent p0){
  ModelAccess.instance().runWriteInEDT(new Runnable(){
@Override
public void run(){
  node.property=cb.isSelected();
}});
}};
cb.addActionListener(actionListener);

2 comments

Use editorContext.getRepository().getModelAccess().

1

Sergej.. Thank you very much.

0

Please sign in to leave a comment.