|
Re: How to create programmatically a new view on a diagram representation [message #1722059 is a reply to message #1722027] |
Tue, 02 February 2016 14:23 |
|
Hi Benoit,
Le 02/02/2016 11:57, Benoit Ries a écrit :
> Hi,
>
> I looked for an API method to create a new view on a diagram
> representation given an existing semantic element (EObject) but could
> not find any.
> How can I do that programmatically ?
Note that this will produce no effect if your are in auto-refresh, with
a synchronized mapping (ie mapping configured as synchronized or
configured as unsynchonizable with the diagram set to synchronized). In
this configuration the element you might want to create will already be
on the diagram and the auto refresh will remove the doublons.
But for an unsynchonized mapping (ie mapping configured as
unsynchronized or configured as unsynchonizable with the diagram set to
unsynchronized), you might want to programmaticaly create a view for a
knwon mapping and a specific domain object. (You might also want to call
a tool, but this might be answered in another thread).
I think you should try to instantiate and execute
org.eclipse.sirius.diagram.tools.api.command.view.CreateDDiagramElementCommand.CreateDDiagramElementCommand(TransactionalEditingDomain,
EObject, AbstractNodeMapping, DragAndDropTarget) (or its pendant edge
specific constructor)
Note that if your domain object is not in the result of the mapping
semantic candidates filtered by the domain class and the precondition,
the view you create should be removed by the refresh done in precommit
or by the next refresh (manual refresh mode)
>
> many thanks in advance for any hints,
> Benoît
>
>
Regards
--
Maxime - Obeo
Need training or 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.02689 seconds