2

In my Eclipse RAP application, I need to have a component change the way it looks whenever any other component opens a dialog box (or any other element in the foreground). How do I have my component detect when this happens? I have tried using Display.addListener/addFilter, but those do not get events when JFace Dialogs open up.

[As an aside, the reason for this is that this component contains a Java applet, and Java applets do not obey z-ordering, so the applet appears on top of the foreground dialog box.]

Phoebe
  • 2,774
  • 3
  • 22
  • 27

1 Answers1

2

If you add a display filter for the SWT.Activate event, you should be notified for every shell that becomes active, including JFace dialogs. This works for me with RAP 2.0 M3, but should also work with earlier versions.

display.addFilter( SWT.Activate, new Listener() {
  public void handleEvent( Event event ) {
    System.out.println( display.getActiveShell() );
  }
} );
RĂ¼diger Herrmann
  • 20,512
  • 11
  • 62
  • 79
ralfstx
  • 3,893
  • 2
  • 25
  • 41