Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » how to add notes when creating diagram programmatically( how to add notes when creating diagram programmatically)
how to add notes when creating diagram programmatically [message #1828757] Thu, 18 June 2020 06:57 Go to next message
Mohit Advani is currently offline Mohit AdvaniFriend
Messages: 28
Registered: May 2019
Junior Member
Hi,

I am trying to add a note on diagram programmatically.

Shape note = NotationFactory.eINSTANCE.createShape();
note.setType("Note");
note.setDescription("note");
parentDiagram.eContents().add(note);

I am getting below exception :

java.lang.UnsupportedOperationException org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.add(EContentsEList.java:809)

Can please some one tell how can i add note on diagram programatically,

Thanks and Regards
Mohit Advani
Re: how to add notes when creating diagram programmatically [message #1828768 is a reply to message #1828757] Thu, 18 June 2020 09:10 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

As I replied in a different post [1], are you sure that is what you want instead of a node mapping with a style "Note"? If so, you can call the service org.eclipse.sirius.diagram.ui.tools.api.util.GMFNotationHelper.createNote(Diagram, String) to create a note with a message.

Best regards,
Steve

[1] https://www.eclipse.org/forums/index.php/t/1104157/


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Thu, 18 June 2020 09:11]

Report message to a moderator

Previous Topic:How to Navigate Programatically
Next Topic:Properties Editor Won't Edit ViewPoint Specification Project?
Goto Forum:
  


Current Time: Thu Apr 25 06:21:08 GMT 2024

Powered by FUDForum. Page generated in 0.02488 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top