Create Node or Container by Selection Wizard [message #1699758] |
Fri, 26 June 2015 11:58 |
Le Chau Nguyen Messages: 19 Registered: August 2012 |
Junior Member |
|
|
Hi All,
I am able to create "Node Creation Tool" or "Container Creation Tool".
Each tool is corresponding to only one Node/Container.
But my problem is I have too many Containers (400 Containers, I generated them programmatically). So I don't want to place 400 tools to Palette. I am trying to add a Tool that after dragging to Canvas, it popups a Selection Wizard that list 400 containers there. After I select a container, it will be draw on Canvas as if I use "Container Creation Tool" to draw it.
I tried in Sirius: right click on tool section --> select "New Element Edition" --> "Selection Wizard". Then I see the Selection Wizard Properties with multiple fields to be filled.
I think "Candidate Expression" field" is for finding the items to be selected in Wizards. But I cannot find the query to list all Club items (FootballClub, USFootballClub, DancingClub etc.) as this model:
"var:clubs", "School.clubs" etc. doesn't work. School::Club just return Club, not all sub Classes of Club. Could you please tell me what I was wrong?
And to place the Container to Canvas as if using "Container Creation Tool", should I make a "New Operation" --> "Create View" under "Selection Wizard"\"Begin"\"Change Context" in Viewpoint Specification Editor ? I tried it, but I don't know how to do next.
[Updated on: Fri, 26 June 2015 12:01] Report message to a moderator
|
|
|
Re: Create Node or Container by Selection Wizard [message #1699762 is a reply to message #1699758] |
Fri, 26 June 2015 12:05 |
|
Hi,
Le 26/06/2015 13:58, Le Chau Nguyen a écrit :
> Hi All,
>
> I am able to create "Node Creation Tool" or "Container Creation Tool".
> Each tool is corresponding to only one Node/Container.
>
> But my problem is I have too many Containers (400 Containers, I
> generated them programmatically). So I don't want to place 400 tools to
> Palette. I am trying to add a Tool that after dragging to Canvas, it
> popups a Selection Wizard that list 400 containers there. After I select
> a container, it will be draw on Canvas as if I use "Container Creation
> Tool" to draw it.
>
> I tried in Sirius: right click on tool section --> select "New Element
> Edition" --> "Selection Wizard". Then I see the Selection Wizard
> Properties with multiple fields to be filled.
> I think:
> "Candidate Expression" field": for finding the items to be showed in
> Wizards. But I cannot find the query to list all Club items
> (FootballClub, USFootballClub, DancingClub etc.) as this model:
>
> "var:clubs", "School.clubs" etc. doesn't work. School::Club just return
> Club, not all sub Classes of Club. Could you please tell me what I was
> wrong?
>
> And to place the Container to Canvas as if using "Container Creation
> Tool", should I make a "New Operation" --> "Create View" under
> "Selection Wizard"\"Begin"\"Change Context" in Viewpoint Specification
> Editor ?
You might return a list of your EClass and, in the tool, use a Java
service to call your factory instance and ask it to create an instance
of the chosen EClass (will be the element variable) and store it in the
semantic element (container) of the clicked view (container view).
Regards,
--
Maxime - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Create Node or Container by Selection Wizard [message #1699772 is a reply to message #1699767] |
Fri, 26 June 2015 13:07 |
|
Le 26/06/2015 14:52, Le Chau Nguyen a écrit :
> Hi Maxime,
> Thank you for your response. Could you tell me more how to return the
> list of my EClass?
> I tried but "var:clubs", "School::Club" but not work, I am still stuck
> here...
> Sorry, I am new to Sirius and Accelleo, so my question is maybe naive :(
>
> Best regards,
> Le Chau
>
In this case, I think a java service might be easier to use to build a
list containing the EClass you want to display.
You can access to each EClass by calling
YourpackagenamePackage.eInstance.getYourClassName().
--
Maxime - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.02915 seconds