当我点击一个过滤器单元格,然后移动到视图中的另一个区域而没有输入过滤器字符串时,即使我没有输入字符串,“清除过滤器”图标也会显示在单元格中。如下面给出的Nattable所示,启用了图标的过滤器列没有输入任何过滤器字符串。是否有方法在FilterRowConfiguration中显式禁用此行为?
Nattable
我在该示例的第一列的_6031_GlazedListsFilterExample
中发现了类似的行为。但是,该示例中的其他列没有如预期的那样显示“清除筛选器”图标。
粘贴FilterRowConfiguration的内容
final DefaultIntegerDisplayConverter idc = new DefaultIntegerDisplayConverter();
final DefaultLongDisplayConverter ldc = new DefaultLongDisplayConverter();
@Override
public void configureRegistry(IConfigRegistry configRegistry)
{
for (int i = 0 ; i < propNames.size() ; i++)
{
configRegistry.registerConfigAttribute(
FilterRowConfigAttributes.TEXT_MATCHING_MODE,
TextMatchingMode.REGULAR_EXPRESSION, DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + i);
configRegistry.registerConfigAttribute(
CellConfigAttributes.DISPLAY_CONVERTER,
new LinkerMapFilterRowRegexConverter(), DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + i);
}
configRegistry.registerConfigAttribute( // comparator
FilterRowConfigAttributes.FILTER_COMPARATOR,
Comparator.nullsLast(new DefaultComparator()), DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + propNames
.indexOf(ILinkerMapConstants.PROP_KEY_SYMBOL_SIZE));
configRegistry.registerConfigAttribute( // filter display converter
FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER, idc,
DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + propNames
.indexOf(ILinkerMapConstants.PROP_KEY_SYMBOL_SIZE));
configRegistry.registerConfigAttribute(
FilterRowConfigAttributes.TEXT_MATCHING_MODE,
TextMatchingMode.REGULAR_EXPRESSION, DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + propNames
.indexOf(ILinkerMapConstants.PROP_KEY_SYMBOL_SIZE));
configRegistry.registerConfigAttribute( // comparator
FilterRowConfigAttributes.FILTER_COMPARATOR,
Comparator.nullsLast(new DefaultComparator()), DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + propNames
.indexOf(ILinkerMapConstants.PROP_KEY_SYMBOL_ADDRESS));
configRegistry.registerConfigAttribute( // filter display converter
FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER, ldc,
DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + propNames
.indexOf(ILinkerMapConstants.PROP_KEY_SYMBOL_ADDRESS));
configRegistry.registerConfigAttribute(
FilterRowConfigAttributes.TEXT_MATCHING_MODE,
TextMatchingMode.REGULAR_EXPRESSION, DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + propNames
.indexOf(ILinkerMapConstants.PROP_KEY_SYMBOL_ADDRESS));
}
1条答案
按热度按时间ubof19bj1#
您应该仔细检查
FilterRowDataProvider
的后台数据中是否真的没有值。调试显示筛选器图标的原因。因为只有在后台数据中设置了一个值时才应该显示它。