- Posts: 5
- Thank you received: 0
×
Modelio 4.0.0 released (07 Nov 2019)
Modelio 4.0.0 has been released ( www.modelio.org/forum/4-announcements/45...-4-0-0-released.html )
[Solved] Customize PropertyPages
- INTO-CPS-Rasmus
-
Topic Author
- Offline
- Fresh Boarder
-
Less More
7 years 10 months ago #3280 by INTO-CPS-Rasmus
Hi
I have a couple of questions about the PropertyPage for a new module. Lets use the SysMLArchitect Block as an example.
1. I would like to add new properties in the PropertyPage when a Block is selected. I can currently add them, but I can not get the code right for changing them.
One property I would like to add is a string, which should be changed by writing a new string.
2. I would like to get the properties in a PropertyPage from a selected model element when doing a command.
I imaging it would be something like modelelt.getPropertyPage(int row).
Best regards,
I have a couple of questions about the PropertyPage for a new module. Lets use the SysMLArchitect Block as an example.
1. I would like to add new properties in the PropertyPage when a Block is selected. I can currently add them, but I can not get the code right for changing them.
One property I would like to add is a string, which should be changed by writing a new string.
2. I would like to get the properties in a PropertyPage from a selected model element when doing a command.
I imaging it would be something like modelelt.getPropertyPage(int row).
Best regards,
Please Log in or Create an account to join the conversation.
- INTO-CPS-Rasmus
-
Topic Author
- Offline
- Fresh Boarder
-
Less More
- Posts: 5
- Thank you received: 0
7 years 10 months ago - 7 years 10 months ago #3284 by INTO-CPS-Rasmus
Hi again,
So I discovered the solution to my problem from a night sleep.
For reference what I did was the following.
Create a block stereotype in my own module.xml with a different ID from SysMLArchitect, and add my own TagTypes.
Then I created a new BlockPropertyPage for my own module and used the following update and change.
Now if I want to get this value from a command I call the following where modelet is the model element selected.
Regards
So I discovered the solution to my problem from a night sleep.
For reference what I did was the following.
Create a block stereotype in my own module.xml with a different ID from SysMLArchitect, and add my own TagTypes.
Then I created a new BlockPropertyPage for my own module and used the following update and change.
public void update(ModelElement element, IModulePropertyTable table) {
String value_kind = ModelUtils.getTaggedValue("ToolPath", element);
table.addProperty(SysMLResourcesManager.getInstance().getPropertyName("ToolPath"),value_kind);
public void changeProperty(ModelElement element, int row, String value) {
if(row == 1){
ModelUtils.addValue("HelloWorld","ToolPath", value, element);
}}
Now if I want to get this value from a command I call the following where modelet is the model element selected.
ModelUtils.getTaggedValue("ToolPath", modelelt)
Regards
Last Edit: 7 years 10 months ago by INTO-CPS-Rasmus.
Please Log in or Create an account to join the conversation.
Time to create page: 0.032 seconds