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

Bug 329798

Summary: [General] Cannot define different editors for the same EObject using an additional filter
Product: [Modeling] Papyrus Reporter: Yann Tanguy <yann.tanguy>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: cletavernier
Version: 1.0.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Yann Tanguy CLA 2010-11-09 09:49:58 EST
Currently it does not seem to be possible to have distinct editors for the same element with a filtering condition :
e.g the selected EObject is a Property and I want to register 
- A UML editor for Property
- A SysML editor if the Property is Stereotyped ConstraintProperty
- A SysML editor if the Property is a Part
- ...

Let me know if I missed something offering such capability.

Also, is it possible to register Diagram specific editor (relying on the kind of selected GraphicalEditPart rather than the semantic element) ?
Comment 1 Remi Schnekenburger CLA 2010-11-10 05:17:42 EST
(In reply to comment #0)
> Currently it does not seem to be possible to have distinct editors for the same
> element with a filtering condition :
> e.g the selected EObject is a Property and I want to register 
> - A UML editor for Property
> - A SysML editor if the Property is Stereotyped ConstraintProperty
> - A SysML editor if the Property is a Part
> - ...
> 
> Let me know if I missed something offering such capability.
> 
> Also, is it possible to register Diagram specific editor (relying on the kind
> of selected GraphicalEditPart rather than the semantic element) ?

No, you missed nothing, it is only possible to register a property editor given the type of element, it does not provide an advanced filter.

For the selected edit part: I would prefer not to rely only on the kind of Edit part selected, as the editor should be able to work on property views or model explorer. Also, the extension point should stay independant of the GMF framework.

=> A way to define specific filters should be implemented in the embedded editor framework. Perhaps something inspired from the filters of the property views could be implemented.