private final Menu colHeaderMenu;
public RightClickColumnHeaderMenuConfiguration(NatTable natTable,
TableModel tableModel) {
PopupMenuBuilder builder = new PopupMenuBuilder(natTable)
.withHideColumnMenuItem().withShowAllColumnsMenuItem()
.withAutoResizeSelectedColumnsMenuItem()
.withColumnStyleEditor().withColumnRenameDialog();
if (tableModel.enableColumnCategories) {
builder.withSeparator();
builder.withCategoriesBasedColumnChooser("Select columns");
}
if (tableModel.enableColumnGroups) {
builder.withSeparator();
builder.withColumnChooserMenuItem();
}
if (tableModel.enableFilterRow) {
builder.withSeparator();
builder.withClearAllFilters();
builder.withToggleFilterRow();
}
colHeaderMenu = builder.build();
addDisposeListeners(natTable);
}