Hi,
Instead of suggesting support for POJO based models and loosing features like undo and redo, what do you think of adding support so that users can attach their own pojos to GNode and GConnection...
// attach pojo to Gnode:
MyNodeModel myNodeModel = new MyNodeModel();
myNodeModel.setAtt1("val");
myNodeModel.setAtt2(123);
GNode node = GraphFactory.eINSTANCE.createGNode();
node.setData(myNodeModel)
// to retrieve the attached pojo - perhaps after selection or something
Object obj = node.getData();
// or preferably
MyNodeModel myNodeModel = node.<MyNodeModel>getData();
// attach pojo to GCconnection
graphEditor.setOnConnectionCreated((connection, command) -> {
MyConnectionModel myConnectionModel = new MyConnectionModel();
myNodeModel.setAtt1("val");
myNodeModel.setAtt2(123);
connection.setData(myConnectionModel);
});
// to retrieve the attached pojo - perhaps after selection or something
Object obj = connection.getData();
// or preferably
MyConnectionModel myConnectionModel = connection.<MyConnectionModel>getData();
Hi,
Instead of suggesting support for POJO based models and loosing features like undo and redo, what do you think of adding support so that users can attach their own pojos to GNode and GConnection...
// attach pojo to Gnode:
MyNodeModel myNodeModel = new MyNodeModel();
myNodeModel.setAtt1("val");
myNodeModel.setAtt2(123);
GNode node = GraphFactory.eINSTANCE.createGNode();
node.setData(myNodeModel)
// to retrieve the attached pojo - perhaps after selection or something
Object obj = node.getData();
// or preferably
MyNodeModel myNodeModel = node.<MyNodeModel>getData();
// attach pojo to GCconnection
graphEditor.setOnConnectionCreated((connection, command) -> {
MyConnectionModel myConnectionModel = new MyConnectionModel();
myNodeModel.setAtt1("val");
myNodeModel.setAtt2(123);
connection.setData(myConnectionModel);
});
// to retrieve the attached pojo - perhaps after selection or something
Object obj = connection.getData();
// or preferably
MyConnectionModel myConnectionModel = connection.<MyConnectionModel>getData();