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.
精彩评论