Eclipse RCP处理Custommerration例外

发布于 2025-02-10 08:45:25 字数 229 浏览 2 评论 0原文

我在Eclipse RCP应用程序中有一个模型。有时会创建新的模型版本,因此现有模型会迁移。这可以通过实施Custommigration类来完成。使用编辑器实现打开模型文件时进行此迁移。

如果此迁移因某种原因失败,则无法迁移该模型。问题在于,在这种情况下,编辑器仍在打开,但由于没有有效的模型,这将行不通。这将导致像损坏的编辑器窗口和异常一样的混乱。 如何避免这种混乱?有理由流产编辑的开头过程吗?还是可以在打开窗口之前进行迁移?

I have a model in an Eclipse RCP application. Sometimes a new model version is created, so the existing model gets migrated. This can be done by implementing the CustomMigration class. This migration takes place when opening the model file with a editor implementation.

If this migration fails for some reason, the model can not be migrated. The problem is, in this case the editor is still being opened, but this will not work because there is no valid model. This will cause a mess like a broken editor window and exceptions.
How can this mess be avoided? Is there a reason to abort the opening process of the editor? Or is it possible to do the migration before the window is opened?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文