Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » MultiText bounds
MultiText bounds [message #1220566] Thu, 12 December 2013 14:48 Go to next message
Robert Brodt is currently offline Robert Brodt
Messages: 608
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

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 20:49 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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: Thu Oct 02 06:43:01 GMT 2014

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

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