Skip to main content



      Home
Home » Modeling » Graphiti » MultiText bounds
MultiText bounds [message #1220566] Thu, 12 December 2013 09:48 Go to next message
Eclipse UserFriend
Hi all,

My application uses a MultiText as a child of a rectangle container shape. The desired behavior is to have the container shape resize automatically as the MultiText is extended beyond the bounds of the container (i.e. as the user is editing the text for the MultiText in a property view.) To do that, I need to know the bounds of the MultiText to determine if it exceeds the bounds of the container shape. Is there a way to calculate the MultiText bounds?

Thanks,
Bob
Re: MultiText bounds [message #1220822 is a reply to message #1220566] Fri, 13 December 2013 15:49 Go to previous message
Eclipse UserFriend
Bob,

we have just implemented this feature as an enhancement for the upcoming 0.11.0 release (Luna, June 2014), see https://bugs.eclipse.org/bugs/show_bug.cgi?id=415884.

For now we only have a method in stock that can calculate text sizes without taking line breaks/new lines into account. See IUIService.calculateTextSize. As a workaround you might try to call Draw2D's method we also use directly:
org.eclipse.draw2d.TextUtilities.INSTANCE.getTextExtents(text, swtFont);

Michael
Previous Topic:Share the same editingDomain in MultiPageEditor
Next Topic:Color of Text in MultiText
Goto Forum:
  


Current Time: Sun Jul 06 05:30:15 EDT 2025

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

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

Back to the top