可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I'm developing an application based on Eclipse's Rich Client Platform that relies heavily on the use of tables for showing and editing data. I'm currently using the SWT implementations of Table and TableViewer.
My users are forever complaining that it "doesn't work like in excel". Most notably, I can't select a single cell within a row and all rows have the same height. I'm looking for an implementation that addresses these issues.
Criteria:
- Free (as in speech and beer -- I'm a phd student and the program is EPL)
- SWT (the various solutions for including swing in SWT aren't very nice)
Edit:
So far I have the following suggestions:
- Ktable
- Nebula Grid Widget
- NatTable
- Agile Grid
- Jaret Table
Unfortunately, a cursory glance provides no information about the differences between these implementations. I'll of course be looking for solutions and report back here, but do you have any advice on the subject?
回答1:
Check out the Nebula Grid component. It's still being developed, so is not 100% mature, but seems to meet your needs.
回答2:
3 others
NatTable
Agile Grid
Jaret Table
回答3:
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.
回答4:
KTable is mature and very customizable. I used it to provide a very excel-like experience for my SWT app.
回答5:
NatTable is tended to provide a high performance and huge volume capability
回答6:
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.
回答7:
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.]
回答8:
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.