Skip to main content



      Home
Home » Eclipse Projects » Sirius » Different containers for superclass and subclass
Different containers for superclass and subclass [message #1740968] Sun, 21 August 2016 17:09 Go to next message
Eclipse UserFriend
Hi,
I'm new to creating editors with Sirius and I have the following EMF meta-model:

http://i.stack.imgur.com/5WjSb.png

I want to create a Sirius editor for the given meta-model with different representations for Superclass A and Subclass B. Both classes A and B can be instantiated and class B has additional attributes and references. In the representation for Subclass B, I only want to show a limited number of attributes from Superclass A and a few additional attributes from Subclass B. The idea is now to have different containers and depending on which class it is I want to show the respective container. So far when I have two Containers defined in the Sirius editor, one for each class and I create an Instance of Subclass B I get now two containers in the representation, one with the representation meant for Superclass A and one with the representation meant for Subclass B. Is there any way I can tell Sirius to only show the container of the respective class?

Any help would be appreciated!
Re: Different containers for superclass and subclass [message #1741104 is a reply to message #1740968] Tue, 23 August 2016 03:07 Go to previous message
Eclipse UserFriend
Hi Thomas,

It seems you should restrict your "SuperClassA" mapping to instances of SuperTypeA.

You can do this with a semantic candidates expression like aql:self.yourContainmentReference.oclIsTypeOf(yourPackage::SuperTypeA)

For your mapping (if direct chidren of the default layer), self will be the semantic element on which you created the diagram.

Without this filtering, Sirius will accept each candidatate which is a instance or any subtype of the mapping's domain class.

Regards,

--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Tue, 23 August 2016 03:11] by Moderator

Previous Topic:Storable values in SiriusLayoutDataManager
Next Topic:External Java Action to set a value
Goto Forum:
  


Current Time: Mon Mar 17 23:21:06 EDT 2025

Powered by FUDForum. Page generated in 0.02538 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top