使用 Eclipse 数据绑定撤消/重做且不使用 EMF
在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
撤消/重做功能主要需要类似操作的东西,如果您使用 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...