Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Text versus MultiText(Can multitext also show ellipsis)
Text versus MultiText [message #650249] Sun, 23 January 2011 18:47 Go to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
Registered: October 2010
Senior Member
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 09:54 Go to previous messageGo to next message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
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] Fri, 28 January 2011 04:16 Go to previous messageGo to next message
Panneer Selvam is currently offline Panneer SelvamFriend
Messages: 8
Registered: May 2010
Junior Member
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 10:11 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 20:31 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
Registered: October 2010
Senior Member
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 10:54 Go to previous messageGo to next message
Maqsood Ahmed is currently offline Maqsood AhmedFriend
Messages: 41
Registered: September 2010
Member
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 21:40 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
Registered: October 2010
Senior Member
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 09:11 Go to previous message
Maqsood Ahmed is currently offline Maqsood AhmedFriend
Messages: 41
Registered: September 2010
Member
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 09:15]

Report message to a moderator

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


Current Time: Fri Mar 29 06:21:40 GMT 2024

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

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

Back to the top