GWT 2.1 树还是 CellTree?

发布于 2024-09-29 02:31:58 字数 418 浏览 0 评论 0原文

我真的很难在 GWT Tree 小部件之间做出选择,它多年来一直是 GWT 的一部分;或 GWT 2.1 引入的新 CellTree。

我想要呈现给用户的树并不是特别大,但我非常关心响应能力。

树节点上的数据将是可编辑的。通过单击节点,用户会将节点置于编辑模式。编辑更简单的节点将只需要一个 TextBox 或 TextArea;但其他的会涉及几个小部件,我想通过 CSS 对其进行样式控制。

我对 CellTree 方法很感兴趣,因为它似乎提供了极大的灵活性和速度;但是,CellTree 编辑的示例代码仅处理非常简单的数据类型:字符串、日期、整数等。我不知道当您有更复杂的节点编辑需求时,CellTree 是否合适。

你怎么认为? CellTree 是最好的方法吗? CellTree 一般会取代 Tree 吗?在它们之间进行选择时我可以应用哪些启发法?

I'm really struggling with a choice between the GWT Tree widget, which has been a part of GWT for ages; or the new CellTree, which is introduced by GWT 2.1.

The tree I want to present to the user is not particularly large, but I am very concerned about responsiveness.

The data at the nodes of the tree will be editable. By clicking on a node, the user will put the node into edit mode. Editing the more simple nodes will require only a single TextBox or TextArea; but others will involve several widgets, over which I want styling control via CSS.

I'm attracted to the CellTree approach because it seems to offer great flexibility and speed; however, the sample code for CellTree editing deals with only very simple data types: string, date, integer, etc. I don't know if CellTree is appropriate when you've got more complex node-editing needs.

What do you think? Is CellTree the best approach? Does CellTree replace Tree in general? What heuristics can I apply in choosing between them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼睛会笑 2024-10-06 02:31:58

我正在使用带有多个自定义输入单元格的 CellTable,其中一个单元格由许多小部件组成。效果很好!

我花了几个小时才了解如何实现可以执行复杂操作的自定义 Cell - 由于 Cell 的单个实例将在 CellTree 中移动,假装是许多实例,因此您需要了解它如何获取数据以及当它被刷新和渲染时。我从 DatePickerCell 的源码中学到了很多东西。

我不能代表 CellTree,但 CellTable 非常灵活,易于编程,并且为我节省了数百个 Widget 实例。

I'm using a CellTable with several custom input Cells, including one comprised of many widgets. It works great!

It took me a couple of hours to understand how to implement a custom Cell that could do complex operations - since a single instance of the Cell will flit around the CellTree, pretending to be many instances, you need to understand how it's getting its data and when it is refreshed and rendered. I learned a lot from the source of the DatePickerCell.

I can't speak for CellTree, but the CellTable is very flexible, was easy to program, and saves me hundreds of Widget instances.

情定在深秋 2024-10-06 02:31:58

使用 CellTree 是有问题的。因为它无法很好地访问存储在 CellTree 中的视图实现。它会导致问题(例如对我来说:D),通过单击整个父单元格来创建带有子节点的自定义处理程序来打开节点。当然,您可以通过 AbstractCell 制作自定义单元格,但您必须编写自己的渲染器。

我认为这个小部件必须得到增强,并且必须让更多对象对用户更加可见。

自定义 CSS 很简单。您所要做的就是扩展 CellTree.resource 并根据 celltree.css 类名插入自己的 css。

Using CellTree is problematic. Because it hasn't good access to view implementation stored in CellTree. It cause problem (ex. for me :D) in making custom handlers for opening nodes with children by clicking on whole parent cell. Of course you can make custom cells by AbstractCell, where you must write own renderer.

I think this widget must be enchanced and more objects must be more visible for users.

Customizing CSS is simple. All what you have to do is extende CellTree.resource and insert own css based on celltree.css class names.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文