英文:
Nattable Display converter shifts columns when the table is scrolled horizontally
问题
我在我的Nattable的某些列上使用了自定义的DisplayConverter。这个displayconverter将长值显示为十六进制字符串。
每当我水平滚动我的Nattable时,这个转换器会将一个或多个列向右移动。这导致应该显示十六进制值的列以默认的数字格式显示。另一方面,应该显示数字的列显示十六进制值。
在以下图片中,第一张图片显示了应该显示的方式,也就是第2列和第7列应该显示十六进制值(这些只是应用了我的自定义转换器的长值)。当我将表向右滚动时,这个转换器会应用到第3列和第8列。
我已经将我的CustomDisplayConverter(列覆盖HEX_FORMAT)应用到了特定的列上。LinkerMapHexAddressDisplayConverter是自定义的显示转换器,将长值转换为十六进制字符串进行显示。
英文:
I have used a custom DisplayConverter on some columns of my Nattable.This displayconverter shows long values as hex strings.
Whenever I scroll my Nattable horizontally, this converter shifts one/mulitple columns. This results in columns which show hex values to be shown in default numeral format. On the other hand, columns which should be showing numerals show hex values.
In the following images, the first image shows how it should be displayed, that is column number 2 and 7 should show hex values (these are just long values with my custom converter applied).
When I scroll my table to the right, this converter is then applied to column number 3 and 8.
I have applied my CustomDisplayConverter ( column override HEX_FORMAT) to certain columns. LinkerMapHexAddressDisplayConverter is the custom display converter which converts long values to hex strings for display.
'columnLabelAccumulator.registerColumnOverrides(
pnames.indexOf(ILinkerMapConstants.PROP_KEY_SECTION_SIZE), NUMBER_FORMAT);//column 3
columnLabelAccumulator.registerColumnOverrides(
pnames.indexOf(ILinkerMapConstants.PROP_KEY_OBJECT_SIZE), NUMBER_FORMAT);//column 8
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER,
new DefaultLongDisplayConverter(), DisplayMode.NORMAL, NUMBER_FORMAT);
columnLabelAccumulator.registerColumnOverrides(
pnames.indexOf(ILinkerMapConstants.PROP_KEY_SECTION_ADDRESS), HEX_FORMAT);//column 2
columnLabelAccumulator.registerColumnOverrides(
pnames.indexOf(ILinkerMapConstants.PROP_KEY_OBJECT_MODULE_ADDRESS),
HEX_FORMAT);//column 7
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER,
new LinkerMapHexAddressDisplayConverter(), DisplayMode.NORMAL,
HEX_FORMAT);'
答案1
得分: 0
这种情况发生在你在ViewportLayer
或更高层级上应用自定义标签(在你的情况下是HEX_FORMAT
)时。如果你的结构关系很强,你应该将标签应用在DataLayer
上,因为这里没有索引位置的转换。
英文:
This happens if you apply your custom labels (HEX_FORMAT
in your case) on the ViewportLayer
or above. If you have a strong relation on the structure, you should apply the labels on the DataLayer
as there is no index-position conversion.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论