简体   繁体   English

使用Eclipse-Databinding和不使用EMF的撤消/重做

[英]Undo/Redo with Eclipse-Databinding and without EMF

What is the common way to implement undo/redo when using Eclipse-Databinding in an Eclipse Application? 在Eclipse应用程序中使用Eclipse数据绑定时,实现撤消/重做的常用方法是什么? When I search at Google, everybody advice to use EMF, but EMF is restricted at my company. 当我在Google上搜索时,每个人都建议使用EMF,但是EMF受我公司的限制。 I know the use of operations and so on, but at which point I should generate them when using Databinding? 我知道操作的用法等,但是使用数据绑定时应该在什么时候生成它们?

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. 撤消/重做功能主要需要类似操作的操作,如果您使用Eclipse,则已经存在一种结构,可以在具有撤消/重做结构的操作中包装大量工作。 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 (eg you cannot use BeansObservables because databinding is simply calling a setter on your target, not an operation. 但是,如果您使用数据绑定,那么最重要的部分是您必须实现自己的可初始化和执行操作的目标可观察对象(例如,您不能使用BeansObservables因为数据绑定仅是在目标上调用设置器,而不是操作。

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. 长话短说:您必须复制捆绑org.eclipse.emf.databinding.edit实现的内容,并用您自己的Operations和Command-stack替换EMF命令和Commandstack。 This bundle gives you a good overview what and where needs to be implemented and how this can be achieved... 该捆绑包为您提供了一个很好的概述,说明什么地方需要实施以及如何实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM