Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to add some Text to a Note programmatically?
How to add some Text to a Note programmatically? [message #639184] Mon, 15 November 2010 14:49 Go to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi,

I've added a note to my diagram programmatically (in a Handler):

Node note = ViewService.createNode(notationalDiagram, ViewType.NOTE, [MyModel]DiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
ShapeImpl noteImpl = (ShapeImpl)note;
noteImpl.setFillColor(8905185);
noteImpl.setDescription("DataBase: " + databaseItem.getName());//don't work...!!!


How can I add some text to this note?

Thanks, regards

Giovanni
Re: How to add some Text to a Note programmatically? [message #639195 is a reply to message #639184] Mon, 15 November 2010 15:21 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

can you be more precise on how it doesn't work?
Do you have a stacktrace? Is it only a refresh issue?

First thing that come to me, are you in a transaction when you are calling the setDescription?

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: How to add some Text to a Note programmatically? [message #639205 is a reply to message #639195] Mon, 15 November 2010 15:36 Go to previous messageGo to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Aurelien,

no, I got no errors or exceptions, I just see the Note correctly displayed on the diagram but without text inside; furthermore, I called the methods in a AbstractTransactionalCommand, so I thought it must work....maybe the "setDescription" is not the right method to call?

Thanks for your answer, regards

Giovanni.
Re: How to add some Text to a Note programmatically? [message #639216 is a reply to message #639205] Mon, 15 November 2010 16:09 Go to previous message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Sorry Aurelien,

the "setDescription" method is working fine, I can see the description value correctly set in the resource file; but my needs are to display some text inside the Note programmatically created: how can I reach this goal?

Thanks,

Giovanni.
Previous Topic:Connection feedback points in opposite direction
Next Topic:Attributes of referenced class access in properties view
Goto Forum:
  


Current Time: Fri Apr 26 07:33:38 GMT 2024

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

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

Back to the top