NatTable如何隐藏单元格的边框线
How to hide the border line of cells in NatTable
我想在 NatTable (Nebula) 中隐藏单元格的边界线。我尝试使用 Style
(设置厚度 = 0)但尚未成功:
Style textCellStyle = new Style();
textCellStyle.setAttributeValue(
CellStyleAttributes.BORDER_STYLE,
new BorderStyle(0, GUIHelper.COLOR_BLUE, LineStyleEnum.DASHED));
你能给我一些指导吗?非常感谢!
更新:我使用的代码:
NatTable natTable = new NatTable(parent, false);
ConfigRegistry configRegistry = new ConfigRegistry();
natTable.setConfigRegistry(configRegistry);
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
configRegistry.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
Boolean.FALSE);
///...
CompositeLayer composeLayer = new CompositeLayer(2, 2);
composeLayer.setChildLayer(GridRegion.CORNER, cornerLayer, 0, 0);
composeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 1, 0);
composeLayer.setChildLayer(GridRegion.ROW_HEADER, rowHeaderLayer, 0, 1);
composeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 1, 1);
natTable.setLayer(composeLayer);
natTable.refresh();
我们如何才能仅在 BODY 中应用解决方案的 Dirk?
我猜你说的是网格线而不是边界线。
您可以通过
禁用网格线渲染
configRegistry.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
Boolean.FALSE);
以下代码只是注册正文区域的设置:
configRegistry.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
Boolean.FALSE,
DisplayMode.NORMAL,
GridRegion.BODY);
我想在 NatTable (Nebula) 中隐藏单元格的边界线。我尝试使用 Style
(设置厚度 = 0)但尚未成功:
Style textCellStyle = new Style();
textCellStyle.setAttributeValue(
CellStyleAttributes.BORDER_STYLE,
new BorderStyle(0, GUIHelper.COLOR_BLUE, LineStyleEnum.DASHED));
你能给我一些指导吗?非常感谢!
更新:我使用的代码:
NatTable natTable = new NatTable(parent, false);
ConfigRegistry configRegistry = new ConfigRegistry();
natTable.setConfigRegistry(configRegistry);
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
configRegistry.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
Boolean.FALSE);
///...
CompositeLayer composeLayer = new CompositeLayer(2, 2);
composeLayer.setChildLayer(GridRegion.CORNER, cornerLayer, 0, 0);
composeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 1, 0);
composeLayer.setChildLayer(GridRegion.ROW_HEADER, rowHeaderLayer, 0, 1);
composeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 1, 1);
natTable.setLayer(composeLayer);
natTable.refresh();
我们如何才能仅在 BODY 中应用解决方案的 Dirk?
我猜你说的是网格线而不是边界线。
您可以通过
禁用网格线渲染configRegistry.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
Boolean.FALSE);
以下代码只是注册正文区域的设置:
configRegistry.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
Boolean.FALSE,
DisplayMode.NORMAL,
GridRegion.BODY);