如何使用 GWT 2.1 数据呈现小部件
在 2010 年 Google IO 上,宣布 GWT 2.1 将包含新的数据呈现小部件。 2.1M 可供下载,并且可能包含小部件,但尚未出现任何文档。
有关于如何使用它们的简短教程或示例吗?我看到一个谣言:CellList 和 CellTable 是有问题的类。他们的 Javadoc 充满了大量的 TODO,因此在使用方面仍然缺少相当多的内容。
At the 2010 Google IO it was announced that GWT 2.1 would include new Data Presentation Widgets. 2.1M is available for download, and presumably the widgets are included, but no documentation has yet surfaced.
Is there a short tutorial or example for how to use them? I've seen a rumor that CellList and CellTable are the classes in question. The Javadoc for them is riddled with lots of TODOs, so quite a bit is still missing in terms of usage.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Google I/O 2010 - GWT用户界面检修
2.1 中的 javadocs 包 com.google.gwt.cell.client
里程碑 2 的 Eclipse 更新站点
当代码位于 bikeshed 中时,将此行添加到您的 gwt.xml 文件中:
以下示例如下:
TextCells 的PageSizePager
SimplePager
SimplePager 和 PageSizePager(有问题)
和
文本单元格标题
Google I/O 2010 - GWT's UI overhaul
javadocs package com.google.gwt.cell.client in 2.1
Eclipse update site for milestone 2
While the code is in bikeshed, add this line to your gwt.xml file:
The following examples follow:
PageSizePager
SimplePager
SimplePager and PageSizePager(buggy)
and
TextCell header
我有一个可编辑 CellTable 的工作原型。该原型有一个表,显示字符串、布尔值、日期、整数列,每个列都有编辑器。编辑每个单元格会更新相应的模型。
I have a working prototype of an editable CellTable. The prototype has a Table displaying String, Boolean, Date, Integer columns with editors for each. Editing each cell updates the corresponding model.
要在表中显示多列,您需要将数组放入列表中。实现这一点的参考代码是:
To show multiple column in table you need to put array in list. The reference code to achieve this is:
以下代码是我正在编写的代码,希望对您有所帮助:
The following code is what I'm woking on, hope it'll be helpful:
上面的 Antony.trupe 给出了很好的答案。
如果你想要一个可编辑的单元格,你可以将这段代码添加到他的类中,并实例化这样一个列,而不是常规的
TextColumn
。我确信您了解
FieldUpdater
部分。它基本上是为了更新底层模型而设计的——这对于String
来说是不可能的。稍后我将尝试发布一个更完整的示例。
Great answer from antony.trupe above.
If you want to have an editable cell, you could add this piece of code to his class, and instanciate such a column instead of the regular
TextColumn
.I'm sure you understand the
FieldUpdater
part. It's basically designed to update the underlying model -- which is not possible in the case ofString
.I'll try to post a more complete example later on.
您可能想看看 Spring Roo 项目。 Spring Roo 通常用于构建 Java 应用程序。在最新的 1.1 版本中,它还可以构建 GWT 应用程序(使用许多 GWT 2.1 功能)。
它可以为您生成大量 GWT 2.1 代码,然后您可以看到所有内容如何协同工作。关于 Spring Roo 的信息也在 GWT 2.1 发行说明中给出,并且该工具在 Google I/O Keynote 中介绍过(非常有趣,视频可以在此处)。
编辑:
Spring Roo 中甚至还有一个完整的 GWT 2.1 应用程序(费用应用程序)示例。要生成此应用程序,您只需安装 Roo 1.1,然后在 roo 控制台中执行:
You may want to take a look at Spring Roo project. Spring Roo in general is used to scaffold Java applications. In the newest version 1.1 it can also scaffold GWT applications (using many GWT 2.1 features).
It can generate a lot of GWT 2.1 code for you and then you can see how everything works together. The information about Spring Roo is also given in GWT 2.1 release notes and the tool was presented in Google I/O Keynote (it is really interesting, the video can be found here).
Edit:
There is even a complete example of GWT 2.1 application (Expenses application) in Spring Roo. To generate this application you only need to install Roo 1.1 and then execute this in roo console: