// To improve user experience, the selection is the editor's input file.
IStructuredSelection selection = this.selection;
Object obj = selection.getFirstElement();
if (obj instanceof GraphEditor) {
GraphEditor editor = (GraphEditor) obj;
IEditorInput input = editor.getEditorInput();
if (input instanceof IFileEditorInput) {
IFile file = ((IFileEditorInput) input).getFile();
selection = new StructuredSelection(file);
}
}