Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Best way to listen to context activation/deactivation
Best way to listen to context activation/deactivation [message #337069] Sun, 26 July 2009 00:32 Go to next message
Sed Mising name is currently offline Sed Mising nameFriend
Messages: 22
Registered: July 2009
Junior Member
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 14:25 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Tue Apr 23 07:54:57 GMT 2024

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

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

Back to the top