title: How to get "active editor" in Eclipse plugin?
body: <p>In my Eclipse plugin, I need to know when the editor that is visible on the screen has changed. I am currently getting the active editor as follows:</p>
  
  <pre><code>PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
  </code></pre>
  
  <p>This works for most cases except for when the green Continue button is pressed:</p>
  
  <p><img src="https://i.stack.imgur.com/6MbPZ.png" alt="Debugger buttons"></p>
  
  <p>If I use the F8 shortcut then the active editor is updated as expected.</p>
  
  <p>It seems that the active editor property is not updated until the editor tab gets focus (which doesn't happen when the Continue button is pressed).</p>
  
  <p>Is there any other route that I can take to get the "visible editor"?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Alan</p>