Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364803 - Editor API: Listener Optimizations
Summary: Editor API: Listener Optimizations
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Juno M5 Theme_round_offs
Keywords:
Depends on:
Blocks: 336488
  Show dependency tree
 
Reported: 2011-11-25 05:22 EST by Michael Wenz CLA
Modified: 2012-06-29 04:16 EDT (History)
1 user (show)

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-11-25 05:22:14 EST
This is a split-off from bug 336488; it should be used to seperatly discuss the listener mechanisms used in the diagram editor
Comment 1 Michael Wenz CLA 2011-11-25 05:26:10 EST
2 findings:
1)
cmdStackListener: CommandStackEventListener (GEF)
fwListener:  FWCommandStackListener -> CommandStackListener (EMF)
Do we really need both listeners? Both update the dirty state, the GEF listener also the contributed actions. Proposal: remove the EMF listener; all executed commands shall be GEF commands running on the GEF command stack

2)
domainModelListener: DomainModelChangeListener -> ResourceSetListener
diagramChangeListener: DiagramChangeListener -> ResourceSetListener
I wonder if unifying would again be a better approach here? Having one listener that does the following:
a) Loop over all changed domain objects and try to identify the according pictogram elements (as done in DomainModelChangeListener)
b) Loop over all changed pictogram elements and all pictogram elements from step a to identify the edit parts that need an update (as done in DiagramChangeListener)
b) Do a selective refresh of these edit parts not the global one from the DomainModelChangeListener (as it is done in DiagramChangeListener)
I also wonder if we might get duplictate refreshs with the current approach?
Comment 2 Michael Wenz CLA 2011-11-29 07:57:51 EST
(In reply to comment #1)
> 2)
> domainModelListener: DomainModelChangeListener -> ResourceSetListener
> diagramChangeListener: DiagramChangeListener -> ResourceSetListener
> I wonder if unifying would again be a better approach here? Having one listener
> that does the following:
> a) Loop over all changed domain objects and try to identify the according
> pictogram elements (as done in DomainModelChangeListener)
> b) Loop over all changed pictogram elements and all pictogram elements from
> step a to identify the edit parts that need an update (as done in
> DiagramChangeListener)
> b) Do a selective refresh of these edit parts not the global one from the
> DomainModelChangeListener (as it is done in DiagramChangeListener)
> I also wonder if we might get duplictate refreshs with the current approach?

Rethinking 2) it's probably a bad idea: having two distinct listeners has the benefit that clients can easily disable one (e.g. the EMF domain listener in case of a non-EMF domain model) while letting the other one (diagram listener) operating. Besides it will make the coding easier to understand.
Comment 3 Michael Wenz CLA 2011-11-30 03:59:36 EST
1) is done, checked in to the branch bug336488 and pushed to Eclipse:
commit c3d5c0ad1519f6b5e235c81db255b192c8cc0ade
Author: mwenz <michael.wenz@sap.com> 2011-11-29 15:14:13
Committer: mwenz <michael.wenz@sap.com> 2011-11-29 17:03:51
Parent: 713cc97c132150305430fb35d8db2ff514017d46 (.)
Child: 156d48d94da5ed0ab5561e0c311a47cdf5d70922 (Fixed failing test)
Branches: origin/bug336488, bug336488
Comment 4 Michael Wenz CLA 2011-12-21 10:53:21 EST
Has been integrated back into master and pushed to Eclipse.
Comment 5 Michael Wenz CLA 2012-04-11 10:49:33 EDT
Bookkeeping: Set target release
Comment 6 Michael Wenz CLA 2012-06-29 04:16:57 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)