| Summary: | UIEventPublisher does not handle Notification.ADD_MANY and REMOVE_MANY | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Brian de Alwis <bsd> | ||||
| Component: | UI | Assignee: | Brian de Alwis <bsd> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | dean.t.roberts, emoffatt, pwebster, remy.suen | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | 4.2.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Brian de Alwis
We should also see if we can adjust to handling the EMF 'move' semantic (where you don't do an explicit 'remove' from the current parent, you just do an 'add' to the new one. There is a way to detect that this is the case in the event but I've forgotten what it is... Brian, would you be able to look at this in 4.2.1? PW Sure Created attachment 217822 [details]
patch v1
This patch adds support for three new event types to UIEvents.EventTypes (ADD_MANY, REMOVE_MANY, and MOVE) correspond to EMF's notification types. It also adds a new event property to (UIEvents.EventTags.POSITION) to record where operations took place (primarily for MOVE, but also useful for REMOVE and REMOVE_MANY).
Unlike ADD and REMOVE, ADD_MANY and REMOVE_MANY report collections of the added/removed objects. In changing existing code to handle both ADD/ADD_MANY and REMOVE/REMOVE_MANY, I ended up adding two helper functions to UIEvents:
* contains(Event e, String propName, Object o): check if a property contained a particular value (e.g., in MinMaxAddon: to check if new tags contains "Minimized" on ADD_MANY)
* asIterable(Event e, String propName): return an iterator over the property regardless of whether a single instance or a collection (e.g., for PartRenderingEngine to iterate over multiple elements in an ADD_MANY)
I haven't adapted any code to make use of MOVE -- that should be done separately, IMHO.
Fix committed to master (24bfc76ae59a0a8b47f7fde56797921723f6f994) *** Bug 317419 has been marked as a duplicate of this bug. *** Verified in M20120829-1200 |