A more advanced table/spreadsheet SWT implementation

故事扮演 提交于 2019-11-30 03:29:48

Check out the Nebula Grid component. It's still being developed, so is not 100% mature, but seems to meet your needs.

I think SWT Matrix has the features you're looking for.

It has a symmetrical design thus the rows and columns have the same representation, which means they can all be selected, moved, hidden, resized, etc., like in excel. Cell navigation and selection also is excel-like. And all key and mouse gestures are bound to the same actions as in spreadshits.

The component is closed source but free for private and non-commercial use. Still alpha stage at this point, though.

KTable is mature and very customizable. I used it to provide a very excel-like experience for my SWT app.

NatTable is tended to provide a high performance and huge volume capability

I've been using the Nebula Grid component, as previously mentioned, in a project at work, and in general I'd have to say I think it works pretty well. There are some performance issues, and it isn't quite finished, but it's pretty easy to bend to whatever shape you need, and does a good job of spreadsheet-style tables of data. You can have column and row headings, column groups, custom cell renderers, etc.

My most recent problem with it is getting line heights to be calculated correctly, and it doesn't look like there's much active development happening at the moment, so I will be trying to fix it myself.

NatTable is free, fast and powerful.

Since this question was first asked, it has become part of the Eclipse Nebula project. Development is still active.

The API is huge. A huge set of examples provide simple sample code to get started.

Some nice features:

  • Can handle huge datasets without performance issues
  • Row headers
  • Spanning cells
  • Tree table
  • Cell editors: text, combo, checkbox
  • Standard actions to copy, export to Excel, and print.
  • Validation and visual indication of invalid values
  • Multi-cell editing
  • Cell decorators
  • Persist state of column sizing, order, hiding, sorting, etc.

Run the examples to see the speed and power. Be aware that you must add the SWT plugin to your classpath. The examples don't include it. Here's an example:

C:> java -cp C:\eclipse\plugins\org.eclipse.swt.win32.win32.x86_VERSION.jar;NatTableExamples-0.9.0.jar org.eclipse.nebula.widgets.nattable.examples.NatTableExamples

[Thanks to posters from prior years for mentioning NatTable. This answer provides an update and more information.]

KTable is similar to JTable.

Nebula Grid fits in well with the Widget + Viewer paradigm. I was able to migrate from normal SWT table to this in a matter of minutes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!