> after thinking a little on it, what do you think if we implement the > showEllipsis style for the Label, but in a class derived form label, > to avoid if/checks etc ? >
showEllipsis would be a boolean style in LabelSkin. Creating a subclass just to avoid an if statement seems a bit much :-) > And, to generalize this, enable this only when a width constraint is > enabled in the label (as in many graphics programs) without asking the > container of the label. > Then, there we could also have a default behavior (truncate the string > at the right length, and could not be so light to calculate it, this > is the real reason I think to move in a subclass of Label), and maybe > other behaviors, for example when I display a file with full path it's > more useful to truncate the final part of the path but keep the name > part if possible, etc ... > The use case is valid - it's been a TODO in LabelSkin since its creation (before the days of JIRA, which is why it's not in JIRA). It would only come into play in layout(), since the preferred size of the label wouldn't be affected by this style. > Then, I'm thinking if this could makes sense also for the TextInput > (maybe) and TextArea (maybe but this is much more complex so maybe > only a simple case could be handled, or nothing :-) ) components ... > I don't think I've ever seen a text area with an ellipsis, but I have seen it used (very rarely) in text inputs. > > > I can open a ticket for it, maybe for the 1.5. > Up to you on whether to open a ticket. We have a lot of TODOs in code that hark back to the pre-ASF days, and I don't really think we need to create tickets for all of them (we've been knocking them off one by one - creating tickets would yield a lot of spam).