* @return the active editor, if any
* @throws WidgetNotFoundException if there is no active editor.
* @since 1.1
*/
public static SWTBotEclipseEditor activeEditor() throws WidgetNotFoundException {
Object editor = UIThreadRunnable.syncExec(new ObjectResult() {
public Object run() {
try {
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getReference(activeEditor);
} catch (RuntimeException e) {