简体   繁体   English

如何在NatTable中隐藏单元格的边界线

[英]How to hide the border line of cells in NatTable

I wanto hide the boder line of cells in NatTable (Nebula). 我想在NatTable(Nebula)中隐藏细胞的边界线。 I tried with Style (set thickness = 0) but not yet successful : 我尝试使用Style (设置厚度= 0),但尚未成功:

Style textCellStyle = new Style();
textCellStyle.setAttributeValue(
                        CellStyleAttributes.BORDER_STYLE,
                        new BorderStyle(0, GUIHelper.COLOR_BLUE, LineStyleEnum.DASHED));

Can you give me some guide? 你能给我一些指导吗? Thank you very much! 非常感谢你!

Update : the code that I used: 更新 :我使用的代码:

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();

How can we apply the solution's Dirk in the BODY only? 我们如何仅在身体中应用解决方案的Dirk?

I suppose you are talking about the grid lines and not border lines. 我想您是在谈论网格线而不是边界线。

You can disable grid line rendering via 您可以通过以下方式禁用网格线渲染

configRegistry.registerConfigAttribute(
            CellConfigAttributes.RENDER_GRID_LINES, 
            Boolean.FALSE);

The following code just registers the setting for the body region: 以下代码仅注册了主体区域的设置:

configRegistry.registerConfigAttribute(
            CellConfigAttributes.RENDER_GRID_LINES, 
            Boolean.FALSE,
            DisplayMode.NORMAL,
            GridRegion.BODY);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM