简体   繁体   English

星云-将网格转换为NatTable

[英]Nebula - Convert a grid into a NatTable

I'm looking to convert a nebula grid into a NatTable. 我想将星云网格转换为NatTable。 My goal is to be able to generate an excel file automatically using this code : 我的目标是能够使用以下代码自动生成excel文件:

final ExportCommand cmd = new ExportCommand(natTable.getConfigRegistry(), natTable.getShell());
natTable.doCommand(cmd);

Do you know if it is possible? 你知道有可能吗?

Thanks 谢谢

There is no simple way to convert from an SWT Table, JFace TableViewer or Nebula Grid to a NatTable. 没有简单的方法可以从SWT表,JFace TableViewer或星云网格转换为NatTable。 They have completely different architectures and designs. 它们具有完全不同的体系结构和设计。 The mentioned three implementations use the native OS table, or at least simulate the same, while NatTable is completely custom painted. 提到的三种实现使用本机OS表,或至少模拟该表,而NatTable是完全自定义绘制的。 Another fact is that those three implementations are created column by column, while NatTable uses an IDataProvider that is two-dimensional by design, so there is no column-by-column approach. 另一个事实是,这三个实现是逐列创建的,而NatTable使用的IDataProvider的设计是二维的,因此没有逐列方法。

I explained this also in our Getting Started Tutorial . 我也在《 入门指南》中对此进行了解释。

So no, there is no simple way to convert. 因此,没有简单的转换方法。 You need to create it from scratch. 您需要从头开始创建它。 But that should be no big deal when checking our examples. 但这在检查我们的示例时应该没什么大不了的。 Well, of course that depends on the features you want to use. 好吧,这当然取决于您要使用的功能。

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

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