SWT学习笔记——JFace中TableViewer的使用及注意事项

9 篇文章 0 订阅
[color=red][size=xx-large]问题:[/size][/color]
1、使用CellEditor时出现org.eclipse.core.runtime.AssertionFailedException: assertion failed:
[size=large][color=red]原因(使用TextCellEditor时CellModifier的getValue函数返回值必须为String类型的)[/color][/size]
[quote]you have either not set the CellModifier for the TableViewer (using the setCellModifier() function)

or, if you have, then the getValue() function of your ICellModifier descendant returns either null or not a String object.
The return value of getValue() is an object, but if you are using a TextCellEditor, it has to return a String.[/quote]

引用自:[url]http://stackoverflow.com/questions/1390613/how-to-resolve-assertionfailedexception[/url]

[color=red][size=xx-large]教程列表:[/size][/color]

使用TableViewer编辑数据貌似有两种方法,此外不用TableViewer时可以添加button等控件:
1、对整个table提供统一的编辑策略
例如(比较详细的教程,含按列排序、filter等功能,分在4篇博客里):
[url]http://www.blogjava.net/dreamstone/archive/2007/08/05/134498.html[/url]
2、对每一列单独提供(感觉这种方法更清晰简洁,不需要各种字符串判断了)
[url]http://study-swt.info/viewers/sample_editable_table.html[/url]
3、不使用TableViewer,添加button等控件
[url]http://www.blogjava.net/Javawind/articles/131557.html[/url]

4、其他教程(详细,含高亮特定字段的功能):
[url]http://www.vogella.de/articles/EclipseJFaceTableAdvanced/article.html[/url]

5、在表格中的不同位置弹出不同菜单(杂乱的教程,直接查看类:Snippet311)
[url]http://hi.baidu.com/if1i/blog/item/29f057d1bb9a55dd572c8433.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值