Meaning that setting the column width to -1 in a TableView may have serious performance implications, so it is not a good idea to use it unless you know that you won't have too many rows in your table.
On Nov 18, 2009, at 9:31 AM, Greg Brown wrote: > For TablePane, -1 is the common case. For TableView, it is not. TableViews > are likely to display hundreds or thousands of rows, whereas TablePanes may > only have a dozen or less. > > On Nov 18, 2009, at 9:29 AM, Noel Grandin wrote: > >> >> I would have thought that setting the columnWidth to -1 was the normal >> case - certainly I prefer to let things size themselves. >> >> But then I'm a big fan of what the web boys call "dynamic layout" i.e. >> not hardcoding pixel sizes anywhere. >> >> I'll check in the rest of the variableRowHeight code without changing >> TextArea. >> >> Greg Brown wrote: >>> Again, the point is that neither of these methods should be called by >>> TerraTableViewSkin unless the column width is set to -1 (an edge case, for >>> now). TerraTableViewSkin should only be calling >>> getPreferredHeight(column.getWidth()), for which TextAreaSkin does report a >>> valid value. >>> >>> >>> On Nov 18, 2009, at 9:17 AM, Noel Grandin wrote: >>> >>> >>>> The code in TextAreaSkin currently looks like this: >>>> @Override >>>> public int getPreferredWidth(int height) { >>>> return 0; >>>> } >>>> @Override >>>> public Dimensions getPreferredSize() { >>>> return new Dimensions(0, 0); >>>> } >>>> >>>> So it really doesn't matter what TerraTableViewSkin does. >>>> >>>> >>>> Greg Brown wrote: >>>> >>>>> To clarify, if TerraTableViewSkin is currently asking the renderer for >>>>> its unconstrained preferred width when the column width is *not* set to >>>>> -1, it is probably a bug. >>>>> >>>>> On Nov 18, 2009, at 9:09 AM, Greg Brown wrote: >>>>> >>>>> >>>>> >>>>>> My point is that TableView shouldn't ever be asking for the renderer's >>>>>> unconstrained preferred width unless the column width is set to -1. I >>>>>> would consider that an edge case for now. >>>>>> >>>>>> On Nov 18, 2009, at 9:06 AM, Noel Grandin wrote: >>>>>> >>>>>> >>>>>> >>>>>>> The height is fine, it's the width that is a problem. >>>>>>> >>>>>>> The situation is that I'm putting a TextArea to use as a cell renderer >>>>>>> in a TableView, and I need it to return a useful width to the TableView. >>>>>>> >>>>>>> Greg Brown wrote: >>>>>>> >>>>>>> >>>>>>>> Under what circumstances is this an issue? Can't we just ask the >>>>>>>> renderer for its constrained preferred height (based on the column >>>>>>>> width) when variableRowHeight is set to true? Actually, I would think >>>>>>>> we should be doing that either way. The only time this wouldn't work >>>>>>>> is when the column width is set to -1, but I would think that could be >>>>>>>> considered an edge case for now. >>>>>>>> >>>>>>>> I'm reluctant to make any non-critical changes to TextArea at this >>>>>>>> point, since it is a very complex component and I don't want to >>>>>>>> introduce any issues before we release 1.4. >>>>>>>> >>>>>>>> G >>>>>>>> >>>>>>>> On Nov 18, 2009, at 7:06 AM, Noel Grandin wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Hi >>>>>>>>> >>>>>>>>> I note that TextAreaSkin returns [0,0] in getPreferredSize(). >>>>>>>>> >>>>>>>>> Is there a reason for this behaviour? >>>>>>>>> I was trying to use TextArea as a renderer for my variableRowHeight >>>>>>>>> TableView, but without a real preferredSize it doesn't work too well. >>>>>>>>> >>>>>>>>> Thanks, Noel. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>> >>> >>> >> >