Page 1 of 1

Add an Icon to Grouped Row

PostPosted: Mon Apr 17, 2017 3:46 am
by jsavoretti
I am Using this below piece of code.
Code: Select all
    _tableModel = new PluginAccessTableModel();
    FilterableTableModel filterableTableModel = new FilterableTableModel(_tableModel);
    _groupTableModel = new DefaultGroupTableModel(filterableTableModel);
   
    //grouping on the first column -Plugin
    //_groupTableModel.addGroupColumn(0, DefaultGroupTableModel.SORT_GROUP_COLUMN_ASCENDING);
    _groupTableModel.addGroupColumn(0);
   
    _groupTableModel.groupAndRefresh();


where PluginAccessTableModel() is an custom Table model. And i am setting the 1st column as Group column.
I am getting the the Grouped table properly, but i want to add an ICon to the Grouped row and add a listener to that ICon.

In the Attachment i have added screen shots of both desired output and actual output that i am having.
In Actual : I am getting Grouped Rows, but there is no Button added to the grouped column.
In Desired : Every thing else should be similar to Actual, and want to add an additional button to the Grouped Row.

Please Guide me how to do it.

Re: Add an Icon to Grouped Row

PostPosted: Mon Apr 17, 2017 9:41 am
by JIDE Support
You can define your own cell renderer to add an icon which is easy. However the question is I guess you want it to be clickable, right? If yes, it is not not easy to do. The icon is just a painted image, it is not an actual button. We tried to make it possible (check the HyperlinkCellDemo) but I am afraid it won't work with the group table.

Re: Add an Icon to Grouped Row

PostPosted: Thu Apr 20, 2017 10:05 pm
by jsavoretti
Thanks for the suggestion, I was trying to see the some example implementation or java doc for HyperlinkCellDemo, but i am unable to find. Can you please help me here.

Re: Add an Icon to Grouped Row

PostPosted: Thu Apr 20, 2017 10:50 pm
by JIDE Support
There is no document for that. All available help are in the HyperlinkCellDemo and the javadoc of TableCellEditorRenderer.