Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Best way to listen to context activation/deactivation
Best way to listen to context activation/deactivation [message #337069] Sat, 25 July 2009 20:32 Go to next message
Eclipse UserFriend
Hello! I have defined a number of 'org.eclipse.ui.contexts' and wish to
have parts of my application respond to when these contexts change from
active and inactive states.

The best I can come up with so far is adding an IContextManagerListener to
IContextService via addContextManagerListener, and then deducing which
context have changed through the ContextManagerEvent (specifically
ContextManagerEvent .getContextManager.getActiveContextIds() and
ContextManagerEvent.getPreviouslyActiveContextIds()).

Is this the best way to do this? Seems like things could get a little
inefficient especially when trying to deduce which context has been
deactivated.

Thanks for any help you can provide!
Re: Best way to listen to context activation/deactivation [message #452925 is a reply to message #337069] Sat, 01 August 2009 10:25 Go to previous message
Eclipse UserFriend
Yes, that's what you need to do. Make copies of the 2 sets and use retainAll and removeAll.

PW
Previous Topic:[commands] override a handler
Next Topic:Select command handler based on where it's triggered from?
Goto Forum:
  


Current Time: Fri Apr 25 19:33:46 EDT 2025

Powered by FUDForum. Page generated in 0.04083 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top