Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347200

Summary: Unable to save diagram
Product: [WebTools] Dali JPA Tools Reporter: Neil Hauge <neil.hauge>
Component: Diagram EditorAssignee: Alexandrina Ivanova <alexandrina.ivanova>
Status: ASSIGNED --- QA Contact: Stefan Dimov <stefan.dimov>
Severity: normal    
Priority: P3 CC: petya.sabeva
Version: 3.0   
Target Milestone: Future   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Neil Hauge CLA 2011-05-25 13:44:25 EDT
Steps to reproduce:

- Create a new JPA project
- Create an Entity with Entity Gen or New Entity wizard
- Open the diagram editor
- Add the entity to the diagram
- Save diagram with Ctrl+S or right click "Save"

Result:  Diagram is not saved, the diagram.xml file has not been updated, and the editor remains in a dirty state.

Workaround:  Close diagram editor and choose to save when prompted if you would like to save or discard your edits.  After doing this, future saves seem to work fine.

This is a main path use case for the diagram editor.  From a first impression and usability standpoint, I think this is an important issue and should be addressed for Indigo.
Comment 1 Alexandrina Ivanova CLA 2011-05-27 10:35:44 EDT
Hello Neil,
I tried to reproduce the problem. After I add the entity to the diagram (drag and drop it from the Project Explorer) I really can not save the diagram. But this is because the diagram isn't on focus - focus is still on the Project Explorer. At this very moment Ctrl+S does nothing and File->Save together with the Save icon are disabled. If I right click on the entity in the diagram and choose Save, this saves the entity's java class, but not the diagram. But when I click on the diagram, it gets on focus and then Ctrl+S saves it successfully.
 Could you try after adding the entity to the diagram, to click somewhere in the diagram field to get the diagram on focus and then press Ctrl+S to check if the problem persists.
Best regards,
Ina
Comment 2 Neil Hauge CLA 2011-05-27 10:58:32 EDT
That makes sense, and would explain why switching to another editor and coming back seemed to resolve the issue.  

Okay...that does appear to be what is happening.  I was right-clicking in the grid and thinking that the save action would correspond to the diagram and not the entity, but the entity is still selected so it instead corresponds to the entity.  I'm not sure how this is generally handled in other editors that have selectable components inside, but I guess this is probably a common usability issue among these types of editors.

Not sure what can ultimately be done about this, but perhaps a "Save diagram" action could be added to the entity context menu.  It would also be nice if certain actions were disabled if they were in a state where that action could not be performed, such as when an entity is not dirty, the Save menu item could be disabled.  I think these types of changes would alleviate possible user confusion.

Thanks for looking into this.  I no longer consider this to be a necessary fix for Indigo.
Comment 3 Neil Hauge CLA 2011-10-27 11:16:36 EDT
The 3.2 target now represents the Juno release.
Comment 4 Petya Sabeva CLA 2012-05-04 02:02:30 EDT
Retargeting this bug to the Kepler realease (3.3).
Comment 5 Petya Sabeva CLA 2013-05-08 07:57:54 EDT
Retargeting this bug to 3.4 release.
Comment 6 Neil Hauge CLA 2014-09-30 16:56:47 EDT
Bulk move to Dali 3.5 as Dali 3.4 has shipped.
Comment 7 Neil Hauge CLA 2015-05-14 14:11:23 EDT
Deferring from 3.5 to Future target.