|
Replies:
5
-
Last Post:
Mar 16, 2009 3:21 AM
by: kleopatra
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
TablePacker class
Posted:
Mar 13, 2009 4:42 AM
|
|
|
Hi, I have implemented a class that automatically resizes colums of a table according to the content (or to prototypes or header sizes). It's configurable and is a bit similar to GridBagLayout. I find it very useful and I want to contribute it to swingx. Maybe it can be used in this context and it can be improved by the wide community.
Where can I upload my class so that you can have a look on it?
I have to add: I have take the original version of this class from http://www.jroller.com/santhosh/date/20061023 and improved it with some configuration stuff.
Ulrich
original source added
Message was edited by: uvoigt
|
|
|
|
|
|
|
Re: TablePacker class
Posted:
Mar 13, 2009 9:39 AM
in response to: uvoigt
|
|
|
Hmm ... JXTable already supports enhanced column resize
- there are pack methods to get the smallest size to fit which is actually implemented in the ColumnFactory. The default measures cell content and/or header or takes the column's prototypeValue to measure. Just subclass to implement custom strategies - there is enhanced support to fit the columns horizontally: see the horizontalScrollEnabled property - there's a visibleColumnCount property which works similarly as the visibleRowCount property
Don't see a need for a dedicated external packer. But would love to hear what you are missing in the support and merge (preferably as a contribution the missing parts.
Our contribution area is the jdnc-incubator project. There's some paperwork involved to get write access, the details are explained there, just replace Richard's email by Alexander's.
CU Jeanette
|
|
|
|
|
|
|
|
Re: TablePacker class
Posted:
Mar 13, 2009 10:18 AM
in response to: kleopatra
|
|
|
> Don't see a need for a dedicated external packer
Do you see a need to express the packing impl as a pluggable provider so you dont need to override table? Couple of times I've wished to the ability to declare a max size for certain columns (numbers, enums, dates) and have the remainder shared by the content length 'unknown' columns.
|
|
|
|
|
|
|
|
Re: TablePacker class
Posted:
Mar 13, 2009 12:27 PM
in response to: osbald
|
|
|
> > Do you see a need to express the packing impl as a > pluggable provider so you dont need to override > table?
confused about what you mean: override table? For JXTable to way to go is ColumnFactory (which I know you know - so my confusion most probably is due to Friday evening If you indeed mean some kind of pluggable strategy for the factory: yes, certainly I would like that (as I always said, and always pointing to my old age implementation documented at swingempire) but need feedback to what exactly would be needed.
Have a nice weekend Jeanette
|
|
|
|
|
|
|
|
Re: TablePacker class
Posted:
Mar 16, 2009 1:24 AM
in response to: kleopatra
|
|
|
I am not very familiar with JXTable. At the moment the major argument for me to use SwingX is the JXTreeTable class. As long as SwingX does not become an 'official' part of the JDK, I don't like to refactor all my table stuff to SwingX. For me the risk is too high that SwingX fades out and I have to refactor all SwingX stuff back to JDK.
So I was looking for an option to automatically resize my table columns no matter if I use JDK classes or SwingX classes. I didn't find very much and so I started to improve one option, which is not perfect at the moment but it works. I will try to upload it, so you may have a look on it. Afterwards you can decide yourself if there are some interesting strategies which could also be used for SwingX.
Ulrich
|
|
|
|
|
|
|
|
Re: TablePacker class
Posted:
Mar 16, 2009 3:21 AM
in response to: uvoigt
|
|
|
fair enough. Just suspect that an external packer might clash with xtable's internal handling. Anyway, looking forward to your contribution, always happy to learn the additional trick of the trade 
CU Jeanette
|
|
|
|
|