Skip to main content



      Home
Home » Modeling » Graphiti » Text versus MultiText(Can multitext also show ellipsis)
Text versus MultiText [message #650249] Sun, 23 January 2011 13:47 Go to next message
Eclipse UserFriend
Hi,

A Text nicely shows an ellipsis in the form of three dots "..." when the displayed text is too long. A MultiText simply breaks the shown string at a word boundary but does not show the ellipsis when the string is too long. As this is a valuable clue for the user, it would be nice if the MultiText would show the ellipsis as well. Is there a way to make this happen, or is this not in the Graphiti framework ?

Jos
Re: Text versus MultiText [message #650296 is a reply to message #650249] Mon, 24 January 2011 04:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jos,
currently this is not supported by Graphiti.

The three dots in a single line text are provided by the underlying Draw2d.

But for a multitext Draw2d doesn't provide such a behaviour.

We discussed this in the team, whether we can solve this in Graphiti, but currently we don't have a suitable solution.

Matthias
Re: Text versus MultiText [message #651158 is a reply to message #650296] Thu, 27 January 2011 23:16 Go to previous messageGo to next message
Eclipse UserFriend
I too wanted exactly the same feature 'ellipse in the multitext', but as it is not available in graphiti, I have implemented a work around to show the '...' in the text based on the text length and container shapes size.

It would be nice if the framework can provide a solution here.

Regards,
Panneer
Re: Text versus MultiText [message #651196 is a reply to message #651158] Fri, 28 January 2011 05:11 Go to previous messageGo to next message
Eclipse UserFriend
Panneer,

please open an enhancement bugzilla regarding this. Maybe you could also add
parts of your workaround coding this bugzilla?

Thanks,
Michael


"Panneer Selvam" wrote in message news:ihtfk8$ajh$1@news.eclipse.org...

I too wanted exactly the same feature 'ellipse in the multitext', but as it
is not available in graphiti, I have implemented a work around to show the
'...' in the text based on the text length and container shapes size.

It would be nice if the framework can provide a solution here.

Regards,
Panneer
Re: Text versus MultiText [message #651428 is a reply to message #651158] Sun, 30 January 2011 15:31 Go to previous messageGo to next message
Eclipse UserFriend
Panneer,

If you would like to share your code, that would be very helpful to me.

Jos
Re: Text versus MultiText [message #658899 is a reply to message #650249] Thu, 10 March 2011 05:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
Lets say a shape is of size width 90,height 30

It can at max show around 11-13 characters per line(of width 90)

Doing the math we find that , (assuming 12 chars )

no.of.chars.possible = (h/15) * (w(12) / 90 )
Ex 1:: w = 90, h = 30
no.of.c.p = 24.

Ex 2:: w=120 h=45
n.of.c.p= 3 * 16 = 48

I then check if the name i am displaying has more than n.of.c.p and if it exceeds , use substring of name and display with ... in the end or beginning where ever u like it.
Re: Text versus MultiText [message #659293 is a reply to message #650249] Fri, 11 March 2011 16:40 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mak,

Thanks fro your answer. You are using a rough estimate, which will probably work most of the time. I was hoping for some code that actually takes the font and character sizes in account.

Regards, Jos
Re: Text versus MultiText [message #659484 is a reply to message #650249] Mon, 14 March 2011 05:11 Go to previous message
Eclipse UserFriend
HI Jos,

Had the Font been even (all characters are of same size)
this would have worked all the time . Neverthless, Graphiti would be providing a solution very soon i believe.

You can make if work all the time by limiting the factor(12) to 10 or 9 chars per line.. in the eqn above. Cool


BR,
Maqsood.

[Updated on: Mon, 14 March 2011 05:15] by Moderator

Previous Topic:How to overlay images
Next Topic:DiagramEditor inside MultiPageEditor?
Goto Forum:
  


Current Time: Tue Jul 01 12:55:58 EDT 2025

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

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

Back to the top