Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323377 - [Generative Tools] Sharing ItemSemanticEditPolicy
Summary: [Generative Tools] Sharing ItemSemanticEditPolicy
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Yann Tanguy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-23 06:36 EDT by Yann Tanguy CLA
Modified: 2010-08-23 06:41 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Tanguy CLA 2010-08-23 06:36:03 EDT
Element that have same nature, of common ancestors (e.g. Classifiers) could share (or inherit from) common ItemSemanticEditPolicy.
Whereas it is possible to add edit policy as a replacement for an existing one in the GMFGen model, ItemSemanticEditPolicy sharing these is difficult due to the host ElementType passed in the constructor.

An alternate solution is to retrieve this element type when needed rather the keeping it as a Class constant. A good candidate for this is UMLBaseItemSemanticEditPolicy#getContextElementType(IEditCommandRequest request) method which could be be overridden. 
This requires the method to be "protected" instead of "private".

Moreover this could also be useful to deal with View / EditPart with no visual id, String semantic hint.
Comment 1 Yann Tanguy CLA 2010-08-23 06:40:22 EDT
Done in r2584.
Comment 2 Yann Tanguy CLA 2010-08-23 06:41:31 EDT
Done in r2584.