Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352109 - Unconditional Auto-refresh for Diagrams
Summary: Unconditional Auto-refresh for Diagrams
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9.0   Edit
Assignee: Michael Wenz CLA
QA Contact:
URL:
Whiteboard: Juno M3 Theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 11:08 EDT by Michael Wenz CLA
Modified: 2012-06-28 10:46 EDT (History)
0 users

See Also:
michael.wenz: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)