Top Nodes with same class Element - no display at the creation [message #235053] |
Thu, 02 July 2009 07:19 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Hi,
What I want :
- one tool in the palette
- multiple choice when I click on the diagram with the creation tool selected
The multiple choice creates element of the same Class but with different "profile",
they are initialized differently.
How I do that :
- one top node for each "profile" with different "feature seq initializer"
Issues :
- It works great only for the first top node.
For the others, the element is created in the model but not display.
It can be displayed only if we done some actions... (trigger the display of the pop-up menu for instance)
So my questions :
- is that a bug or a normal behaviour?
- how can I do otherwise to do what I want? (cf at the beginning)
|
|
|
Re: Top Nodes with same class Element - no display at the creation [message #235065 is a reply to message #235053] |
Thu, 02 July 2009 08:04 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Aurelien Pupier a écrit :
> Hi,
>
> What I want :
> - one tool in the palette
> - multiple choice when I click on the diagram with the creation tool
> selected
>
> The multiple choice creates element of the same Class but with different
> "profile",
> they are initialized differently.
>
>
> How I do that :
> - one top node for each "profile" with different "feature seq initializer"
>
> Issues :
> - It works great only for the first top node.
> For the others, the element is created in the model but not display.
> It can be displayed only if we done some actions... (trigger the display
> of the pop-up menu for instance)
>
>
> So my questions :
> - is that a bug or a normal behaviour?
> - how can I do otherwise to do what I want? (cf at the beginning)
seems related with this bug : https://bugs.eclipse.org/bugs/show_bug.cgi?id=193116
doesn't it?
|
|
|
|
Re: Top Nodes with same class Element - no display at the creation [message #235154 is a reply to message #235107] |
Fri, 03 July 2009 08:23 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Alex Shatalin a écrit :
> Hello Aurelien,
>
>> How I do that :
>> - one top node for each "profile" with different "feature seq
>> initializer"
> In addition to "feature sequence initializer" you have to add
> corresponding Constraints. This is important to let GMF diagram updater
> determine how to represent particular domain model element. E.G.:
> - two node mappings referencing same metaclass with feature initializers
> 1. featureA -> value1 2. featureA->value2
>
> In this case we have to create two constraints featureA = value1 /
> featureA = value2 for each of NodeMappings in accordance.
>
> -----------------
> Alex Shatalin
>
>
Works fine with constraints.
Thx Alex
|
|
|
Re: Top Nodes with same class Element - no display at the creation [message #235225 is a reply to message #235107] |
Fri, 03 July 2009 12:58 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Alex Shatalin a écrit :
> Hello Aurelien,
>
>> How I do that :
>> - one top node for each "profile" with different "feature seq
>> initializer"
> In addition to "feature sequence initializer" you have to add
> corresponding Constraints. This is important to let GMF diagram updater
> determine how to represent particular domain model element. E.G.:
> - two node mappings referencing same metaclass with feature initializers
> 1. featureA -> value1 2. featureA->value2
>
> In this case we have to create two constraints featureA = value1 /
> featureA = value2 for each of NodeMappings in accordance.
>
> -----------------
> Alex Shatalin
>
>
doesn't work so fine finally...
The problem is that featureA after being initialized can switch from value1 to value2... Or I have the constraint for
the top node, so it disappears...
In addition, I want to have multiple initializers so, multiple values and so a lot of duplicate code. (if it was only
generated code which was duplicated it wouldn't be so annoying but I customise display with another XXXeditPartProvider)
So is there another way to propose different initialization to the user?
Adding a menu item directly in the pop-up menu of creation?
other...
|
|
|
Re: Top Nodes with same class Element - no display at the creation [message #235394 is a reply to message #235225] |
Mon, 06 July 2009 11:21 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
> So is there another way to propose different initialization to the user?
> Adding a menu item directly in the pop-up menu of creation?
> other...
I tried to add a menu item in the pop-up menu of creation...
Some difficulties : the Palette Factory is hardcoded so we can't use extension points :
"org.eclipse.gmf.runtime.diagram.ui.paletteProviders"
I can modify XXXPaletteFactory to add entries (in createXXXCreationTool adding an IElementType to the List types)
But where can I modify the behaviour of the creation for each entries?
How can I distinguish entries with the same IElementType? In NoteToolEntry.createTool, properties are set; can I use
them for that?
|
|
|
Powered by
FUDForum. Page generated in 5.05420 seconds