Papyrus Banner

Pre-requisite

We define a static profile, to do so see As an example, we suppose that a static profile with 2 stereotyped classes named Stereotype_A and Stereotype_B has been defined.

How to generate a file.ctx ?

The generator can create a property view configuration from either a UML Profile or an Ecore Meta-model. The wizard is available in the Papyrus category: File -> New -> Other' -> Papyrus/Property view configuration. The wizard provides two default generators:

The source file must be located in your workspace. A default target file named will be filled with the .ctx extension (This is the extension for a property view configuration).

We have to generate a property view from a UML Profile

All the elements from the profile or meta-model will be extracted, with no dependencies to other models. So we choose the strategy � don't generate dependencies �.

Press "next" a table with all the elements extracted from your profile or meta-model is displayed.

This table contains four columns:

The tree structure generated after the creation of the property view configuration.

Modification of the .ctx

A summary of the the property view elements

The editor contains a Tree, containing the following elements :

Add a composite

To proceed with the customization it is necessary to add a composite associated to the target stereotype.

Right click on Single Stereotype_B->New child->Composite Constraint.

Add a PropertiesLayout

Right click on composite->New child ->Layout

Right click on composite->New child ->Property Editor.

For each property the Properties should be field so we can :

For each property chosen, the type must be chosen on the widget type list.

After adding all the desired properties, my .ctx file is as follows.

Note: to display the Data contexts, you need to check the toggle button on top of the editor:

Interaction between Components and pushed customization with java code

Papyrus provides a way to synchronize several widgets between them. Indeed, this is possible by modifying the XWT files corresponding to the desired components. in this example we have chosen to add test property on all the SingleSteretype_B.xwt which contains the name ,label, qualifiedName as well as the multiplicity.

Create a class that inherits from "IPropertiesListener" or use an existing class such as "ReadOnlyStringPropertiesListener". The purpose of this class is to define the behavior of the chosen editor according to the associated input. It is at the ListenerClasses attribute that will be defined this class. The link will be made between the editor and the "PropertiesListener".

In our example : A condition is on the name to make the user notice that the name of the class must imperatively be different from the name of the stereotype. the label is the name chosen for the class. If the name is the same as "steretype_B" the label is read only.

visualization of the exemple on runtime