Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pseudo pojo model #25

Open
jmdsc opened this issue Jul 19, 2015 · 3 comments
Open

Pseudo pojo model #25

jmdsc opened this issue Jul 19, 2015 · 3 comments

Comments

@jmdsc
Copy link

jmdsc commented Jul 19, 2015

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();

@rmfisher
Copy link
Contributor

FYI I'm no longer working at the company that has the copyright on this code. I don't think there'll be any new features added in the near future. My advice would be to fork it and make any changes you wish. All the best.

@jmdsc
Copy link
Author

jmdsc commented Jul 20, 2015

Thanks for the reply Robert.
Do you know if the copyright allows any fork of the code to change package names; would this be ok?

@rmfisher
Copy link
Contributor

Yes I believe that is ok. See here:

https://tldrlegal.com/license/eclipse-public-license-1.0-(epl-1.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants