Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-debug-dev] Programmatically opening an editor during Java breakpoint suspension

Hello,

I am trying to write an IDebugEventSetListener that can highlight a line of 
code in my customized text editor when a Java application is suspended at a 
breakpoint (I am mapping from the Java compilation unit to the input in my 
editor).  However, in handleDebugEvents, I can't figure out a way to 
programmatically open/reveal my editor, as the methods I'm using (e.g. 
getActiveWorkbenchWindow, JavaPlugin.getActivePage, etc) return "null" even 
though the Java editor is displaying the currently executing line.  
Furthermore, when I circumvent this editor access issue and then attempt to 
highlight a line in my editor (setSelection), nothing happens.  That is, 
although no exception is thrown, my editor does not change.  I've tried using 
DebugPlugin.asyncExec(Runnable), but the same problem occurs.

When a Java application is being debugged, is there a "lock" preventing the 
opening of other editors/views?  If not, then is there a way to open an editor 
if I only have the IFile to start with?  Also, I'm trying to find the Java 
editor code that deals with displaying the currently executing line.  Could 
someone point me to there relevant source files?  Any help/suggestions would 
be greatly appreciated.

Thank you,
Kimberly Kuo


Back to the top