使用 Eclipse 数据绑定撤消/重做且不使用 EMF

发布于 2024-12-26 23:44:45 字数 128 浏览 4 评论 0原文

在 Eclipse 应用程序中使用 Eclipse 数据绑定时,实现撤消/重做的常用方法是什么?当我在Google搜索时,每个人都建议使用EMF,但是EMF在我的公司受到限制。我知道操作等的使用,但是在使用数据绑定时我应该在什么时候生成它们?

What is the common way to implement undo/redo when using Eclipse-Databinding in an Eclipse Application? When I search at Google, everybody advice to use EMF, but EMF is restricted at my company. I know the use of operations and so on, but at which point I should generate them when using Databinding?

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

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

发布评论

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

评论(1

纵性 2025-01-02 23:44:45

撤消/重做功能主要需要类似操作的东西,如果您使用 Eclipse,那么已经有一个构造可以将大量工作包装在具有撤消/重做结构的操作中。但是,如果您使用数据绑定,最重要的部分是您必须实现自己的目标可观察对象,用于初始化和执行操作(例如,您不能使用 BeansObservables ,因为数据绑定只是在您的对象上调用 setter 堆栈

长话短说:您必须复制 Bundle org.eclipse.emf.databinding.edit 中实现的内容,并用您自己的操作替换 EMF 命令和命令 命令堆栈。这个捆绑包为您提供了一个很好的概述,需要实现什么、在哪里以及如何实现......

A undo/redo functionality requires mostly something like operations, if you use Eclipse there is already a construct to wrap an amount of work within an operation with undo/redo structures. But if you use databinding, the most important part is that you have to implement your own target-observables that are initializing and executing the operations (e.g you cannot use BeansObservables because databinding is simply calling a setter on your target, not an operation.

Long story short: You have to duplicate what is implemented in the Bundle org.eclipse.emf.databinding.edit and replacing the EMF commands and the commandstack with your own Operations and command-stack. This bundle gives you a good overview what and where needs to be implemented and how this can be achieved...

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