|
Re: Edit a list of parameters [message #788608 is a reply to message #786355] |
Thu, 02 February 2012 01:55 |
Michael Golubev Messages: 383 Registered: July 2009 |
Senior Member |
|
|
Hello,
You may find useful this old code from UML2Tools project.
The code there parses and applies into the UML (Operation + val Parameter[*]) the string like "operation(in p1:T1, inout p2:T2, p3:T3) : RT4", but it may be used just as a sample of integration of javacc-generated parser with GMF-T generated diagram.
Regards,
Michael "Borlander" Golubev
at Montages Think Tank, Prague, Czech Republic
Montages AG, Zürich, Switzerland
|
|
|
Re: Edit a list of parameters [message #797283 is a reply to message #788608] |
Mon, 13 February 2012 09:23 |
Markus Knoop Messages: 14 Registered: January 2012 |
Junior Member |
|
|
Hello,
i don't find a matching solution for me inside this code. I will explain the environment detailt.
We hava an editor based on emf to decribe service classes. This decription of a class could have a undefined list of input parameters. With this editor i create a model with one service with e.g. two input parameter from type int and string.
My second gmf editor could model a process. A node in this process is a servicetask. This has a reference to one service. I could load the servicedescription created before (with the service class) as resource file and now i can choose this service for the reference of the servicetask properties. This currently works.
But i want to extend the servicetask with the input parameters automaticly by select the service.
I think one solution is to implement an own class, that create a containment for each input parameter of the service and add them to ther servicetask-editpart.
Now i add a new class devided from the servicetask-editpart class and overwrite the notifyChanged method. So i be able to recognize the selection of a service class.
How can i create manualy a compartment? I add a compartment to my process model, but i will create and set it inside my new class. By sending a create command (model and view should contain the changes). How can i create this command?
Rgards,
Markus Knoop
[Updated on: Mon, 13 February 2012 13:04] Report message to a moderator
|
|
|
Re: Edit a list of parameters [message #797779 is a reply to message #797283] |
Mon, 13 February 2012 22:09 |
Michael Golubev Messages: 383 Registered: July 2009 |
Senior Member |
|
|
Markus,
Indeed my first answer does not look relevant now. Let me do a second try
So you have something like:
class Parameter { attr String name; ... }
class ServiceClass { val Parameter[*] params; ...}
class Process { ref ServiceClass service; ... }
At the diagram you have a node for Process and some action that allows user to select one of preloaded ServiceClass instances and sets self.service for this node.
Now you want to show the compartment for Parameter's inside the Process node and on every change of self.service to populate this compartment with actual parameters taken from the bound ServiceClass.
So if you have 2 service instances S1 { parameters = {'P1', 'P2'} ...} and S2 { parameters = {'P3'} ...}, and the Process node P you want the diagram show the P-node with compartment that has 0 parameters while the P has not bound to Service, 2 parameters when user set the P.service = S1 and single parameter when user change P.servce = S2.
If this is correct, I would changed the Process to be:
class Process {
ref ServiceClass service;
derived transient volatile readonly ref Parameter[*] serviceParams;
}
implement it in a obvious way and continued with standard GMF definitions (pretending this new 'serviceParams' feature is a containment).
You definitely will need to modify some generated code (block the creation/deletion/... of parameters, refresh the parameters on process#service changes, etc) but GMFT will generate the boilerplate code suitable for your use case. For me, it is definitely better than attempting to mix generated and non-generated code for editparts.
If I missed your point again, please post the relevant part of the models, your actual diagram screenshots and possibly some sketches for desired look and feel.
Regards,
Michael "Borlander" Golubev
at Montages Think Tank, Prague, Czech Republic
Montages AG, Zürich, Switzerland
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03867 seconds