Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323377

Summary: [Generative Tools] Sharing ItemSemanticEditPolicy
Product: [Modeling] Papyrus Reporter: Yann Tanguy <yann.tanguy>
Component: CoreAssignee: Yann Tanguy <yann.tanguy>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.