我正在尝试设置 NatTable 树的样式,以便非装饰物品的缩进与装饰物品的缩进相匹配。所以没有子项和有子项的项目基本上具有相同的缩进。
我使用以下配置的示例:
public class PerfLogTreeConfiguration extends AbstractRegistryConfiguration {
private static final int fTreeIndent = 10;
private static final int fIconSpacing = 2;
private TreeImagePainter fTreeImagePainter = new TreeImagePainter(false,
GUIHelper.getImage("right"), //$NON-NLS-1$
GUIHelper.getImage("right_down"), null); //$NON-NLS-1$
private IndentedTreeImagePainter indentedTreeImagePainter = new IndentedTreeImagePainter(
fTreeIndent,
null,
CellEdgeEnum.LEFT,
fTreeImagePainter,
false,
fIconSpacing,
true);
private PaddingDecorator paddingDecorator = new PaddingDecorator(
indentedTreeImagePainter,
0,
5,
0,
5,
true);
private ICellPainter fTreeStructurePainter = new BackgroundPainter(paddingDecorator);
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(TreeConfigAttributes.TREE_STRUCTURE_PAINTER, fTreeStructurePainter,
DisplayMode.NORMAL);
}