views:

28

answers:

1

Hi there,

once again I've got a question. Since I am using Google Web Toolkit (GWT) at work (along with Java Servlets), I am currently building some user interface with GWT (in Java).

I've got some trouble though. I am using a SplitLayoutPanel which contains a ScrollPanel on the left and another one on the right.

In the left ScrollPanel there's a VerticalPanel with several Labels, which differ in their width. What I want to accomplish, is: if the Label's text doesn't fit in one line, it should display as many characters as possible and have a "..." in the end, if it's not fully displayed.

I am about to add a CustomEvent EventHandler for the Label, which can be fired whenever the Label needs to change its content. Now the problem however is, that I'd need to fire the event whenever the ScrollPanel or its inner VerticalPanel is resized (by dragging the SplitLayoutPanel-Splitter).

Now the question: is it possible to override some sort of "onResize"-Event or at least "onMouseMove"-Event inside the VerticalPanel, so that I could fire the "changeLabelSize()"-method for each Label inside of this VerticalPanel?

How would I go about it? Thank you all for your time in advance! Please ask for anything unclear, so I can clarify it.

Best regards, Igor.

+1  A: 

This can be done easily with the CSS property text-overflow: ellipsis;.

Supported by IE7-, Safari and Konqueror.

And it can be emulated in Firefox.

Jason Hall
Thank you very much - this indeed fixed one part of the problem. Since I only have to support IE8, it's all fine - big thanks to you! :).However I still have another (minor) problem: SplitLayoutPanel.addWest expects a widget and a size. I want the widget that I add using addWest to be of variable size though. I haven't figured out a way to do that, but I am trying - do you have any hint? Thank you very much for your help.
Igor