file taggedvalues : list of values instead of free text

8 years 7 months ago #2659 by ebr
Hi,

I guess that is possible through the Java code of your module not inside the module.xml file.

Regards,

EBR

Please Log in or Create an account to join the conversation.

8 years 5 months ago #2830 by vatsala
I am new to Modelio and I am also looking for similar options, where we can add a dropdown, instead of plain text in a stereotype tagged value.
Could anyone please provide me some reference using which I can start it?
Thank you..

Please Log in or Create an account to join the conversation.

8 years 5 months ago #2831 by ebr
take a look at the Module developer's guide and more specifically at this section .

You will also find an example in SysML module source code i.e. here .

Please Log in or Create an account to join the conversation.

8 years 5 months ago #2833 by jcantoniochamp
Hello Vatsala,

What I did was to checkout the source code for the Java Designer Module.
Basically you need to:
- create your tagged value in the module.xml file
- create module
- in your module add a property page
this.propertyPages.add(new YourPropertyPage(this, "yourPage", "yourPage","res/bmp/yourIcon.png"));
- In this property page you have a method
public void update(List<MObject> selectedElements,
IModulePropertyTable table)
where you would update the property table with the propertyModel
propertyModel.update(table);

you need to create and instantiate the propertyModel.

Say you have the class YourPropertyModel, you will need to override the method update(IModulePropertyTable table)

and add your property list
table.addProperty("your property", "yourKey", list);

Hope this helps,

JClaude

Please Log in or Create an account to join the conversation.

1 year 10 months ago #6294 by joset
Hi,

Can you telle me where to insert code "this.propertyPages.add(" inside the module ?

And why create the page dynamically (java code) instaed of static declaration (module.xml) ?

Thank you, José

Please Log in or Create an account to join the conversation.

1 year 10 months ago - 1 year 10 months ago #6295 by chm
Hi joset,

I'll be starting with your second question.

joset wrote: And why create the page dynamically (java code) instaed of static declaration (module.xml) ?


As EBR said earlier in this thread, you can't declare the properties themselvers in the module.xml file, only indicate a java class:
<property-page name="XXXPropertyPage" label="%XXXPropertyPage.label" image="" class="org.xxx.XXXPropertyPage" />

joset wrote: Can you telle me where to insert code "this.propertyPages.add(" inside the module ?


In the XXXPropertyPage class from the module.xml file you have two methods to implement:
  • the update method to add properties to be displayed.
  • the changeProperty method to react to a property change in the view and modify the model.

You should take a look at the property page section of the module developer's guide for Modelio 3.x or Modelio 4.x .
The signatures are a little different, but it works exactly the same.

Hope this helps,


CHM

Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.043 seconds
^ Back to Top