BeanTableModel and PropertyTableModel

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.

BeanTableModel and PropertyTableModel

Postby MaronA » Mon Dec 22, 2008 3:42 am

Hi,
I am using two ways to show properties first is based on PropertyTableModel and the second on BeanTableModel.
In Property Table when, there is no setter in bean class, this field is disable for editing and user cannot enter edit mode.
In Bean Table is different, user can enter edit mode and change value of cell, but after press enter key and leave edit mode value of the cell backs to properly value.
Is there any way to get behavior of PropertyTableModel in BeanTableModel?

Best Regards Piotr
MaronA
 
Posts: 2
Joined: Mon Dec 22, 2008 3:21 am

Re: BeanTableModel and PropertyTableModel

Postby JIDE Support » Mon Dec 22, 2008 9:44 pm

To show as disabled text to indicate the cell is not editable is really something only available on PropertyTable. In normal JTable or other JIDE tables, this feature is not there. I don't think we want the disabled text feature to be on other tables as that's not what users are used to.

As far as our test shows, I can't enter editing mode if there is no setter, not as what you described that user can edit a cell. I use BeanTableDemo to reproduce it. I only changed the line where a BeanIntrospector is created by adding "parent", "Parent" to the property name list. There is getParent method of JLabel but there is no setParent.

Code: Select all
                    return new BeanIntrospector(JLabel.class, new String[]{"name", "Name", "text", "Text", "parent", "Parent", "icon", "Icon", "opaque", "Opaque", "toolTipText", "ToolTip", "background", "Background", "foreground", "Foreground"}, 2);


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

Re: BeanTableModel and PropertyTableModel

Postby JIDE Support » Mon Dec 22, 2008 9:55 pm

After posting my previous message, I realized the reason the cell is not editable in my test case is because there is no proper cell editor for the parent property. Once knowing that, I figured out where the bug is. I will fix it so that the cell is not editable is there is no setter. Once that is fixed (I will let you know when it is released), you can use the code below to show disabled cell when the cell is not editable.

Code: Select all
        _sortableTable = new SortableTable(_beanTableModel) {
            @Override
            public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
                Component c = super.prepareRenderer(renderer, row, column);
                c.setEnabled(isCellEditable(row, column));
                return c;
            }
        };



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

Re: BeanTableModel and PropertyTableModel

Postby MaronA » Tue Dec 23, 2008 2:43 am

It works fine :)

Thank You very much for your help
Best regards Piotr

PS
Merry Christmas and Happy New Year for all JIDE Software staff
MaronA
 
Posts: 2
Joined: Mon Dec 22, 2008 3:21 am

Re: BeanTableModel and PropertyTableModel

Postby JIDE Support » Tue Dec 23, 2008 2:32 pm

We just release 2.4.8 which fixed this bug.

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


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 17 guests