I found a solution to my problem: I can just access the EditPart via
Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
This works because I can assume that the EditPart has focus when this code is executed, which I forgot to mention in my question.