Skip to main content

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


Debug events are sent in a non-UI thread. To access the active workbench window, and open an editor, etc., you must perform the operation in a UI thread. Use Display.asyncExec(...). See how the debug views in the debug platform handle events as an example.

Darin



kkuo@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

07/25/2003 04:50 PM
Please respond to jdt-debug-dev

       
        To:        jdt-debug-dev@xxxxxxxxxxx
        cc:        
        Subject:        [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
_______________________________________________
jdt-debug-dev mailing list
jdt-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-debug-dev



Back to the top