作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 EditPart 类中,我需要此 EditPart 所属的 GraphicalEditor 的实例。在不将所需对象传递给 EditPartFactories 和 EditParts 的情况下,最简单的方法是什么?
最佳答案
我找到了解决问题的方法:我可以通过访问 EditPart
Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
这是有效的,因为我可以假设执行此代码时 EditPart 具有焦点,我忘记在问题中提及这一点。
关于java - 杰夫 : How to access GraphicalEditor instance from EditPart?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22613809/
在 EditPart 类中,我需要此 EditPart 所属的 GraphicalEditor 的实例。在不将所需对象传递给 EditPartFactories 和 EditParts 的情况下,最简
我是一名优秀的程序员,十分优秀!