Hi everyone,
I have created an eclipse plugin which gets a tree structure from the database with the help from hibernate. When users open an object in the tree an editor comes up with that object as a parameter. When they close the editor the user is asked whether he wants to save or not. The editor is created by getting all properties from the parent object and making labels and text fields for them. Then I loop all children (and grandchildren) and do the same for them. I attach a modifylistener to the text fields that uses the classmetadata to update the properties of each object.
When opening the editor I just do MyObject obj = (MyObject)parameter, and the sample is saved locally. But when the user closes the editor without saving, all changes are still persistent in the tree. I tried refreshing when making the labels and text fields, but this doesn't work.
Anyone has an idea on how to make a temporary object (not attached to ts parent), and only to replace the normal one when the user really asks to save. I tried some things, but keep on running against walls. Hibernate complains about the non-unique key, deleting the old and adding the changed version does not work either.
Best regards,
Leen Toelen
|