开发者

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

开发者 https://www.devze.com 2023-01-08 00:52 出处:网络
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 ex

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

精彩评论

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