Skip to main content



      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 02:57 Go to next message
Eclipse UserFriend
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 05:10 Go to previous message
Eclipse UserFriend
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/

[Updated on: Thu, 18 June 2020 05:11] by Moderator

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


Current Time: Sat Jun 21 14:16:31 EDT 2025

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

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

Back to the top