setRowHeights method

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

setRowHeights method

Postby nicola.gioia » Wed Sep 05, 2007 12:36 am

In the JideTable there are some methods to manage the rowHeights of the JideTable.
When there is an invocation of the method setRowHeight that has the subsequent implementation:
Code: Select all
 
public void setRowHeight(int rowHeight) {
        if (rowHeight <= 0) {
            throw new IllegalArgumentException("New row height less than 1");
        }
        setRowHeights(null);
        super.setRowHeight(rowHeight);
        resizeAndRepaint();
    }


The call of the method setRowHeights(null); in the previous part of code cause a destruction of the old _rowHeights value and a re-inizialization with a new instance.
This cause a destruction of all custom listener attacched to the old instance.
It is possible to change the setRowHeights(null) with somethimg similiar to t.getRowHeights().insertRows(0, t.getRowCount() , rowHeight);
I can't do it ovverriding the method because I can't have a direct access to the setRowHeight(int) of the JTable class without pass throught the setRowHeight(int) of the JideTable class (the first instruction after setRowHeights(null); is "super.setRowHeight(rowHeight);")
Thanks
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am

Postby JIDE Support » Wed Sep 05, 2007 8:08 am

I am not sure if that's the right way to do. If you call setRowHeight, it means you will NOT use rowHeights. At least this is what JTable does. There is a reason for it as using rowHeights to keep various row heights is an expensive thing. If your table has the same row height, it will be a lot of faster than the data is updating constantly.

This cause a destruction of all custom listener attacched to the old instance.

This is very common that developers have to deal with. You can listen to property change listener on "rowHeights" and reinitialize. We did this kind of reinitialization in many places in our code when, for example, table model, table column model, is chagned.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby nicola.gioia » Thu Sep 06, 2007 6:52 am

Ok!
Thanks!
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 12 guests

cron