Question about using TableHeaderPopupMenuInstaller

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Question about using TableHeaderPopupMenuInstaller

Postby weijenli » Thu Sep 19, 2013 6:00 am

Hello,

I use TableHeaderPopupMenuInstaller and TableColumnChooserPopupMenuCustomizer to make a popup menu for the table columns.
Does anyone know how do I put customized separators in the popup menu to separate menuitems?

Thanks,
Larry
weijenli
 
Posts: 12
Joined: Thu Sep 19, 2013 5:48 am

Re: Question about using TableHeaderPopupMenuInstaller

Postby JIDE Support » Thu Sep 19, 2013 7:14 am

In customizePopupMenu method of TableColumnChooserPopupMenuCustomizer, you have the JPopupMenu as parameter so you just call popupMenu.addSeparator().
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
Joined: Sun Sep 14, 2003 10:49 am

Re: Question about using TableHeaderPopupMenuInstaller

Postby weijenli » Thu Sep 19, 2013 10:56 am

I wrote the code below, but neither AAA nor BBB showed up in the popup menu.
Did I do anything wrong?

Thanks.

TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(mytable);
JPopupMenu menu = new JPopupMenu();
JMenuItem item1 = new JMenuItem("AAA");
JMenuItem item2 = new JMenuItem("BBB");

menu.add(item1);
TableColumnChooserPopupMenuCustomizer popupCustomerizer = new TableColumnChooserPopupMenuCustomizer();
popupCustomerizer.customizePopupMenu(mytable.getTableHeader(), menu, 0);
menu.add(item2);
installer.addTableHeaderPopupMenuCustomizer(popupCustomerizer);
weijenli
 
Posts: 12
Joined: Thu Sep 19, 2013 5:48 am

Re: Question about using TableHeaderPopupMenuInstaller

Postby JIDE Support » Thu Sep 19, 2013 11:03 am

It doesn't look like you are using it correctly. Please refer to any of our demos that use installer to see an example. For example, GroupTableDemo, HeaderStyleTableDemo etc.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
Joined: Sun Sep 14, 2003 10:49 am

Re: Question about using TableHeaderPopupMenuInstaller

Postby weijenli » Thu Sep 19, 2013 11:20 am

The demo is great! thanks!
weijenli
 
Posts: 12
Joined: Thu Sep 19, 2013 5:48 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 4 guests