Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Wrap label in a compartment
Wrap label in a compartment [message #204175] Tue, 02 September 2008 10:05 Go to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
Hello,

i want to wrap my label in RectangleCompartment like the pseudo figure
below.
______________
|... |
|----------- |
|here is the |
|text |
|here is ano |
|ther text |
--------------

The textWrap is set on true in the EditPart, but this has no affection.
Can someone help me?

Currently it looks like this:
______________
|... |
|----------- |
|here is the |
|here is ano |
--------------


Greetings
J. Oelerink
Re: Wrap label in a compartment [message #204956 is a reply to message #204175] Wed, 10 September 2008 09:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Jörg,

See org.eclipse.gmf.runtime.diagram.ui.editparts.TextCompartment EditPart
- this is an EditPart used to visualize Note figure with text inside it.
I think you can gather ideas from there.

-----------------
Alex Shatalin
Re: Wrap label in a compartment [message #205415 is a reply to message #204175] Fri, 12 September 2008 11:58 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: July 2009
Junior Member
You will have to change this in the generated code. Find the EditPart that
has the label in the xxx.diagram project. Go to its createContents method
and add line:
YourLabel.setTextWrap(true)
The textWrap setting in Properties used to work in older versions of GMF
but now it doesn't.
This should work unless the Compartment has something to do with this.
Re: Wrap label in a compartment [message #672380 is a reply to message #205415] Fri, 20 May 2011 21:20 Go to previous messageGo to next message
Plecto Missing name is currently offline Plecto Missing nameFriend
Messages: 1
Registered: May 2011
Junior Member
I found this solution helpful and working, but as soon as I re-generate the diagram code the "costumization" is lost! How can I avoid this? I.e., how can I tell Eclipse to do not overwrite the portion of the code I add manually?

Thanks for your help.
Re: Wrap label in a compartment [message #672389 is a reply to message #672380] Fri, 20 May 2011 21:41 Go to previous message
Eclipse UserFriend
Originally posted by:

Am 20.05.2011 23:20, schrieb Plecto:
> I found this solution helpful and working, but as soon as I re-generate
> the diagram code the "costumization" is lost! How can I avoid this?
> I.e., how can I tell Eclipse to do not overwrite the portion of the code
> I add manually?
>
> Thanks for your help.
@generated NOT
Previous Topic:Delete doen't work
Next Topic:Create Connection Buttons next to shape are not working
Goto Forum:
  


Current Time: Thu Apr 25 15:24:45 GMT 2024

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

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

Back to the top