Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » multi-line text editor for label editing
multi-line text editor for label editing [message #177769] Tue, 18 March 2008 05:24 Go to next message
Eclipse UserFriend
Originally posted by: zhihui_yang73.yahoo.com

Hi all,

i need an editpart which is similar as the one used for Note. For now, I
can get the Note shape using NoteFigure. I also use a WrappingLabel to
capture the description of the node. My node wraps the label according to
the size of the figure nicely. However, I can only edit the label content
in a single line text editor, which is not the same as the text editor
used by Note. Can anybody please tell me how I can use multi-line text
editor within my node as what Note does?

Thanks a lot!
Re: multi-line text editor for label editing [message #177935 is a reply to message #177769] Tue, 18 March 2008 17:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.koehnlein.web.de

Spot the WrapLabel in the figure of the edit part, and set
setTextWrap(true)



ZYang wrote:
> Hi all,
>
> i need an editpart which is similar as the one used for Note. For now, I
> can get the Note shape using NoteFigure. I also use a WrappingLabel to
> capture the description of the node. My node wraps the label according
> to the size of the figure nicely. However, I can only edit the label
> content in a single line text editor, which is not the same as the text
> editor used by Note. Can anybody please tell me how I can use multi-line
> text editor within my node as what Note does?
>
> Thanks a lot!
Re: multi-line text editor for label editing [message #177958 is a reply to message #177935] Tue, 18 March 2008 19:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zhihui_yang73.yahoo.com

Hey Jan,

I did set text wrap to true using setTextWrap(true). It wraps my label
nicely according to the size of my node. My problem is that when I try to
edit the label, instead of let me edit the label directly; it shows a
single line text editor on top of the label. I can only edit the content
of my label using that single line text editor. I can see the label
content changed accordingly under the text editor. Once I'm done with the
editing, and click somewhere in the diagram, the text editor will
disappear. It is very annoying and hard to edit when the content of the
label is long. Is there anywhere else I should change in order to edit the
wrapped label directly with a multi-line text editor?

BTW, I am using WrappingLabel with the latest GMF build 2.1M5

Thanks.
Re: multi-line text editor for label editing [message #177990 is a reply to message #177958] Tue, 18 March 2008 19:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zhihui_yang73.yahoo.com

The problem was solved after I replaced WrappingLabel with old WrapLabel.
But still not sure why WrappingLabel works strangely in my case.
Re: multi-line text editor for label editing [message #178218 is a reply to message #177958] Wed, 19 March 2008 20:18 Go to previous message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Hi,

This seems odd. Check which DirectEditManager is being used when
editing the label, by putting a breakpoint in the label's editpart's
performDirectEdit() methods. If your editpart is a subclass to
TextCompartmentEditPart it should be using the TextDirectEditManager
which should show multi-line text.

Regards,
Cherie

ZYang wrote:
> Hey Jan,
>
> I did set text wrap to true using setTextWrap(true). It wraps my label
> nicely according to the size of my node. My problem is that when I try
> to edit the label, instead of let me edit the label directly; it shows a
> single line text editor on top of the label. I can only edit the content
> of my label using that single line text editor. I can see the label
> content changed accordingly under the text editor. Once I'm done with
> the editing, and click somewhere in the diagram, the text editor will
> disappear. It is very annoying and hard to edit when the content of the
> label is long. Is there anywhere else I should change in order to edit
> the wrapped label directly with a multi-line text editor?
>
> BTW, I am using WrappingLabel with the latest GMF build 2.1M5
>
> Thanks.
>
Previous Topic:please help me GMF
Next Topic:Query With method.(createFigure)
Goto Forum:
  


Current Time: Fri Mar 29 09:49:22 GMT 2024

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

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

Back to the top