Hi,
Please see the below image for more clarification.
- JIDE.png (95.67 KiB) Viewed 36738 times
Code snippet:
this.vcfTable.setRowSelectionAllowed(true);
AutoFilterTableHeader header = new AutoFilterTableHeader(this.vcfTable);
header.setAllowMultipleValues(true);
header.setShowFilterIcon(true);
header.setAutoFilterEnabled(true);
header.setUseNativeHeaderRenderer(true);
header.setShowFilterNameAsToolTip(true);
this.vcfTable.setTableHeader(header);
FilterableTableModel tableModel= (FilterableTableModel) TableModelWrapperUtils.getActualTableModel(this.vcfTable.getModel(),FilterableTableModel.class);
tableModel.setAndMode(true);
this.filterField = new QuickTableFilterField(this.vcfTable.getModel()){
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected JidePopupMenu createContextMenu() {
JidePopupMenu jidePopupMenu = super.createContextMenu();
VcfTableModel actualTableModel = (VcfTableModel)TableModelWrapperUtils.getActualTableModel(this.getTableModel(), VcfTableModel.class);
ArrayList<String> invisibleColumnNames = actualTableModel.getInvisibleColumnNames();
if(invisibleColumnNames!=null)
invisibleColumnNames=new ArrayList<String>();
for (Component component : jidePopupMenu.getComponents()) {
if(invisibleColumnNames.contains(component.getName()))
jidePopupMenu.remove(component);
}
return jidePopupMenu;
}
};
this.vcfTable.setModel(this.filterField.getDisplayTableModel());
this.filterField.setHintText(Messages.getMessage(IMessageKeys.TYPE_HERE_FOR_FILTER));
this.filterField.setShowMismatchColor(true);
Regards,
Sachin