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

Bug 352109

Summary: Unconditional Auto-refresh for Diagrams
Product: [Modeling] Graphiti Reporter: Michael Wenz <michael.wenz>
Component: CoreAssignee: Michael Wenz <michael.wenz>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Flags: michael.wenz: juno+
Version: 0.8.0   
Target Milestone: 0.9.0   
Hardware: All   
OS: All   
Whiteboard: Juno M3 Theme_round_offs

Description Michael Wenz CLA 2011-07-14 11:08:09 EDT
Graphiti should offer an additional option to unconditionally do an auto refresh of the diagram when the underlying EMF model changes. Today it is shown in red and has to be refreshed explicitly via the update action.
Comment 1 Michael Wenz CLA 2011-07-14 11:09:09 EDT
Requested by PI Tools and community
Comment 2 Michael Wenz CLA 2011-07-14 11:09:35 EDT
Targeted for Juno
Comment 3 Michael Wenz CLA 2011-10-26 08:49:39 EDT
There are 3 situations in which an update can happen (and can be controlled in Graphiti's Diagram type provider isAutoUpdateAt... methods):
1) On opening an editor: controlled by isAutoUpdateAtStartup, default false: when set to true the editor will perform an update of the complete diagram while opening. The standard implementation in DefaultUpdateDiagramFeature gets all direct shape children of the diagram and checks if there is an update feature for them and executes it if returns true on canUpdate and updateNeeded.
2) On external resource changes: some other editor changes one of the resources the diagram editor holds. Controller by isAutoUpdateAtReset, default true. If true the workspace synchronizer will trigger an update of the diagram via the update feature of the diagram (same as in 1)).
3) On EMF object changes from within the same resource set or editing domain. Controlled by isAutoUpdateAtRuntime, default true. An adapter registered by Graphiti will update the affected pictogram elements by calling their update feature if it indicates true with canUpdate and updateNeeded. But this update will only happen when the editor is already dirty, in case of a saved editor the update will not happen!

Conclusion: for 1) and 2) we already have an unconditional update available (or the user can establish it), it is missing for 3) in case of a saved editor.
Comment 4 Michael Wenz CLA 2011-10-27 06:28:44 EDT
I added a switch to let tool builders enable the undconditional auto update also in the case of a saved editor. For this I introduced a new method in IDiagramTypeProvider with the name isAutoUpdateAtRuntimeWhenEditorIsSaved(); the default implementation in AbstractDiagramTypeProvider returns false which resembles the previous behaviour.
Checked-in to head:
commit ce10134b5ddf050b52bfb806259b6dd197781894
Author: mwenz <michael.wenz@sap.com> 2011-10-27 11:15:51
Committer: mwenz <michael.wenz@sap.com> 2011-10-27 11:15:51
Parent: 970c0ede69424bbb95cfe244aca8b7d111667c4d (Updated to new Orbit repository)
Branches: origin/master, master
Comment 5 Michael Wenz CLA 2012-04-11 10:41:01 EDT
Bookkeeping: Set target release
Comment 6 Michael Wenz CLA 2012-06-28 10:46:22 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)