开发者

How to get from an EditPart to its Editor in Eclipse? (Eclipse plug-in development)

I am writing an eclipse plug-in that extends editor. Inside the editor I put some EditParts. From some of these edit parts I need a reference to their encapsulating editor (so that fo开发者_开发百科r example, when clicking an instance of MyEditPart, I want to programmatically close the editor).

Please advise on the API to get from an EditPart instance to the Editor it is in.

Thanks.


You can try:

IEditorPart editor = ((DefaultEditDomain) getViewer().getEditDomain()).getEditorPart();

from the EditPart.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜