Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355101 - Cloneable Snippets is part of the wrong model element
Summary: Cloneable Snippets is part of the wrong model element
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.2 M2   Edit
Assignee: Eric Moffatt CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 339130
  Show dependency tree
 
Reported: 2011-08-18 11:20 EDT by Dean Roberts CLA
Modified: 2011-09-13 08:45 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Roberts CLA 2011-08-18 11:20:18 EDT
Currently cloneable snippets are part of MApplicationElement.  This is too far up the model inheritance hierarchy.

It should likely be moved to a better place, or become a first class citizen.
Comment 1 Dean Roberts CLA 2011-09-02 10:35:50 EDT
I would suggest that cloneable snippets be a map instead of a list.

It seems that cloneableSnippets are id based and a map would make finding, deleting and insuring singulatiry easier.
Comment 2 Eric Moffatt CLA 2011-09-02 13:53:21 EDT
While making the current list a Map makes perfect sense to me EMF doesn't...;-).

For some reason (still unclear after hunting around a bit) I can't use the EMAP<K,V> type since it appears that it's not serializable (even though both the key (EString) and value (MUIElement) are).

For now I'll do the following:

- Make a new mix-in type 'SnippetContainer' with one feature 'snippets' which is a list of MUIElements.

- Remove the current 'clonableSnippets' feature in ApplicationElement (this was the issue...not *all* elements need to contain snippets)

- Inherit the new SnippetContainer class in both MWindow and MApplication.
Comment 3 Eric Moffatt CLA 2011-09-02 13:58:59 EDT
Committed in >20110902. Updated the model and the relevant model service methods.

Also updated the new Perspective Switcher code and added a 'findSnippet' model service API (since we apparently can't use a map).
Comment 4 Eric Moffatt CLA 2011-09-02 14:35:01 EDT
Fixes by the previous commit