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



Hello Kimberly,

The method used in the Java debugger to highlight the current line is
LaunchView@showEditorForCurrentSelection(). The main methods used in this
process are : #lookupEditorInput(IStackFrame), #openEditor() and
#selectAndReveal(...).

The method call is no directly triggered by the suspend event, but when the
selected element change in the debug view. When the a suspend event occurs,
the selection is set to the current stack frame, so
#showEditorForCurrentSelection() is called.

I don't think there is any lock preventing to open other views or editors.

HTH.

Luc




|---------+------------------------------->
|         |           kkuo@xxxxxxx        |
|         |           Sent by:            |
|         |           jdt-debug-dev-admin@|
|         |           eclipse.org         |
|         |                               |
|         |                               |
|         |           07/25/2003 02: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