public static void setupContext(JEditorPane editorPane) {
EditorKit kit = CloneableEditorSupport.getEditorKit("text/x-scala");
editorPane.setEditorKit(kit);
DebuggerEngine en = DebuggerManager.getDebuggerManager ().getCurrentEngine();
JPDADebugger d = en.lookupFirst(null, JPDADebugger.class);
CallStackFrame csf = d.getCurrentCallStackFrame();
if (csf != null) {
String language = DebuggerManager.getDebuggerManager ().getCurrentSession().getCurrentLanguage();
SourcePath sp = en.lookupFirst(null, SourcePath.class);
String url = sp.getURL(csf, language);
int line = csf.getLineNumber(language);
setupContext(editorPane, url, line);
}
}