ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
try {
Thread.currentThread().setContextClassLoader(newLoader);
Class<WorkEditor> editorClass = (Class<WorkEditor>) newLoader.loadClass(editorClassName);
Constructor<WorkEditor> constructor = editorClass.getConstructor(Shell.class);
WorkEditor editor = constructor.newInstance(getViewer().getControl().getShell());
editor.setWorkDefinition(workDefinition);
WorkItemNode workItemNode = getWorkItemWrapper().getWorkItemNode();
editor.setWork(workItemNode.getWork());
boolean result = editor.show();
return result ? editor.getWork() : null;
} finally {
Thread.currentThread().setContextClassLoader(oldLoader);
}
} catch (Exception e) {
DroolsEclipsePlugin.log(e);