Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCan man edit DDiagram programmatically?
https://www.eclipse.org/forums/index.php/mv/msg/1065419/1691309/#msg_1691309
i want to create a new element in my current opened Diagram Editor, when i click a button in the toolbar menu of eclipse or a new double click command! I don't want to use section tools, so there is anyway to do that? For example my current DDiagram contains 5 Node (Node1, Node2, Node3, Node4, Node5). And now i want to create e new button, which will create a new Edge between Node2 and Node5 when Diagram is opened. Thanks so much for your help. ]]>Minh Hiep Pham2015-04-05T12:17:31-00:00Re: Can man edit DDiagram programmatically?
https://www.eclipse.org/forums/index.php/mv/msg/1065419/1691426/#msg_1691426
Le 05/04/2015 14:17, Minh Hiep Pham a écrit :
> Hi guys,
> i want to create a new element in my current opened Diagram Editor, when
> i click a button in the toolbar menu of eclipse or a new double click
> command!
Did you try the Double click tool [1], which will allow you to specify
some action to trigger when you double-click on a node ?
I don't want to use section tools, so there is anyway to do
> that? For example my current DDiagram contains 5 Node (Node1, Node2,
> Node3, Node4, Node5).
And now i want to create e new button, which will
> create a new Edge between Node2 and Node5 when Diagram is opened. Thanks
> so much for your help.
Did you try the Edge Creation tool [2], which will allow you to click on
the source and then the target of the nodes you want to rely with an edge ?
[quote title=Maxime Porhel wrote on Tue, 07 April 2015 08:21]Hi Minh,
Le 05/04/2015 14:17, Minh Hiep Pham a écrit :
> Hi guys,
> i want to create a new element in my current opened Diagram Editor, when
> i click a button in the toolbar menu of eclipse or a new double click
> command!
Did you try the Double click tool [1], which will allow you to specify
some action to trigger when you double-click on a node ?
I don't want to use section tools, so there is anyway to do
> that? For example my current DDiagram contains 5 Node (Node1, Node2,
> Node3, Node4, Node5).
And now i want to create e new button, which will
> create a new Edge between Node2 and Node5 when Diagram is opened. Thanks
> so much for your help.
Did you try the Edge Creation tool [2], which will allow you to click on
the source and then the target of the nodes you want to rely with an edge ?]]>Nguyen Xuan Nhan2016-03-01T08:01:58-00:00Re: Can man edit DDiagram programmatically?
https://www.eclipse.org/forums/index.php/mv/msg/1065419/1725145/#msg_1725145
Note that if you create directly sirius model like node or edges, they
will dissapear at next refresh.
I advise you to create first the mapping that will represent your
semantic model and second to do the semantic model changes.
For the latter, as Maxime suggested, the best way is indeed to use a
tool to change your model. If your tool is not specific to a node or
edge creation you can use a Generic tool [1] which will call a java
service [2]
Perhaps, you have good reasons to not use a sirius tool. Then you can
create a action in sirius tabbar [3].
If you don't use a sirius tool, don't forget to change your model
through an EMF command as described below.
session.getTransactionalEditingDomain().getCommandStack().execute(new
RecordingCommand(session.getTransactionalEditingDomain()) {
@Override
protected void doExecute() {
//make your changes;
}
});
Le 01/03/2016 09:02, Nguyen Xuan Nhan a écrit :
> Hi Maxime,
> I've the same question, can we create edge between 2 element,
> programmatically? Not using edge creation tool
>
> [quote title=Maxime Porhel wrote on Tue, 07 April 2015 08:21]Hi Minh,
>
> Le 05/04/2015 14:17, Minh Hiep Pham a écrit :
>> Hi guys,
>
>> i want to create a new element in my current opened Diagram Editor, when
>> i click a button in the toolbar menu of eclipse or a new double click
>> command!
>
> Did you try the Double click tool [1], which will allow you to specify
> some action to trigger when you double-click on a node ?
>
> I don't want to use section tools, so there is anyway to do
>> that? For example my current DDiagram contains 5 Node (Node1, Node2,
>> Node3, Node4, Node5).
>
>
> And now i want to create e new button, which will
>> create a new Edge between Node2 and Node5 when Diagram is opened. Thanks
>> so much for your help.
>
> Did you try the Edge Creation tool [2], which will allow you to click on
> the source and then the target of the nodes you want to rely with an edge ?]]>Laurent Fasani2016-03-01T09:07:53-00:00