简体   繁体   English

如何在不使用选择层以外的任何层的情况下冻结可移植的任何列

[英]how to freeze any column of nattable without using any layers other than selection layer

I have added DragDetectListener and run doCommand in that. 我添加了DragDetectListener并在其中运行doCommand It gives true result but column doesn't gets freeze. 它给出了真实的结果,但列没有冻结。 my code is : 我的代码是:

natTable.addDragDetectListener(new DragDetectListener() {
    @Override
    public void dragDetected(DragDetectEvent paramDragDetectEvent) {
        boolean b = natTable.doCommand(new FreezeColumnCommand(glazedListsGridLayer.getcompositeFreezeLayer(), 0));
    }
});

Adding code of layer stack : 添加层堆栈代码:

bodyDataLayer = new DataLayer(bodyDataProvider);
        GlazedListsEventLayer<IzSearchResultRowData> glazedListsEventLayer = new GlazedListsEventLayer<IzSearchResultRowData>(bodyDataLayer, eventList);
        bodyLayer = new DefaultBodyLayerStack(glazedListsEventLayer);
        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(bodyLabelAccumulator);
        // Column header layer
        selectionLayer = bodyLayer.getSelectionLayer();
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(bulkDataManager);
        columnHeaderDataLayer.setRowHeightByPosition(0, 35);
        final FreezeLayer freezeLayer = new FreezeLayer(selectionLayer);
        final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(
                freezeLayer, bodyLayer.getViewportLayer(), selectionLayer);
        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, compositeFreezeLayer, selectionLayer);

Another Thing : I am getting position coordinates through selection layer. 另一件事:我正在通过选择层获取位置坐标。 when i am running freeze command as natTable.doCommand(new FreezeColumnCommand(glazedListsGridLayer.getSelectionLayer(), 0)); 当我将冻结命令作为natTable.doCommand(new FreezeColumnCommand(glazedListsGridLayer.getSelectionLayer(),0))运行时;

Its giving false result. 它给出错误的结果。

Hard to tell without seeing your layer stack. 很难看到您的图层堆栈。 Maybe you have a more complicated layer composition and the command is lost on the way because of the index-position-transformation. 也许您的图层组成更加复杂,并且由于index-position-transformation而使命令丢失。 Try to execute the command on the layer for which you provide the position coordinates. 尝试在为其提供位置坐标的图层上执行命令。

natTable.addDragDetectListener(new DragDetectListener() {
    @Override
    public void dragDetected(DragDetectEvent paramDragDetectEvent) {
        boolean b = glazedListsGridLayer.getcompositeFreezeLayer().doCommand(
            new FreezeColumnCommand(glazedListsGridLayer.getcompositeFreezeLayer(), 0));
    }
});

暂无
暂无

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

相关问题 除了使用 Xpath 之外,还有其他方法吗? - is there any way other than using Xpath for this? 如何仅对 NatTable 中的视口层的选定行数禁用“行选择”? - How to disable "Row Selection" for only selected number of rows of viewport layer in a NatTable? 有没有办法使用循环而不使用除 charAt(0) 以外的任何函数来拆分字符串? - Is there a way to split a string using loops and without using any function other than charAt(0)? 除了用于Java EE的JSF / JSP之外,是否还有其他任何高度集成的表示层工具? - Is there any other strongly-integrated presentation layer tool other than JSF/JSP for Java EE? nattable:如何禁用单个单元格选择? - nattable: how to disable single cell selection? 除了RTFEditorKit以外,有什么方法可以使用Java读取rtf文件吗? - is there any way to read rtf file using java other than RTFEditorKit? 添加,删除和删除数组中的所有方法,而无需使用任何其他数据结构或任何其他导入 - Add,remove and remove All methods in array without using any other data structure or any other imports 如何检查字符串中是否包含数字以外的其他字符? - how to check string contain any character other than number in java? 如何使用php或任何其他语言减小图像文件大小而又不损失质量或分辨率? - How to reduce Image file size without losing quality or resolution using php or any other language? 有没有其他方法可以在不使用Java IDE的情况下进行Hotswap? - Is there any other way to do a Hotswap without using Java IDE?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM