Nattable显示转换器在水平滚动表时移动列。

huangapple go评论67阅读模式
英文:

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.

Default (as it should be)

Scrolled right

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.

huangapple
  • 本文由 发表于 2023年6月2日 14:32:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387658.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定