Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » E4Application ActiveChild RAT(why does it also track ACTIVE_SELECTION?)
E4Application ActiveChild RAT [message #1755763] Tue, 07 March 2017 16:42 Go to next message
darrel karisch is currently offline darrel karischFriend
Messages: 8
Registered: July 2012
Junior Member
is it the intent of E4Application.initializeApplicationServices ActiveChild RAT to also track the selection?

I don't think this is right. shouldn't this be avoided?

event	org.eclipse.e4.core.internal.contexts.ContextChangeEvent 
	context	org.eclipse.e4.core.internal.contexts.EclipseContext	(TrimmedWindowContext)
	key	"org.eclipse.ui.selection"	
	oldValue	EditorSelection  	
runnable	org.eclipse.e4.core.internal.contexts.TrackableComputationExt
	originatingContext	org.eclipse.e4.core.internal.contexts.EclipseContext	(id=22326)
	runnable	org.eclipse.e4.ui.internal.workbench.swt.E4Application$4 
		val$theContext	org.eclipse.e4.core.internal.contexts.EclipseContext  (id=22326)

	static public void initializeApplicationServices(IEclipseContext appContext) {
		final IEclipseContext theContext = appContext;
		// we add a special tracker to bring up current selection from
		// the active window to the application level
		appContext.runAndTrack(new RunAndTrack() {
			@Override
			public boolean changed(IEclipseContext context) {
				IEclipseContext activeChildContext = context.getActiveChild();
				if (activeChildContext != null) add runExternalCode here {
					Object selection = activeChildContext.get(IServiceConstants.ACTIVE_SELECTION);
					theContext.set(IServiceConstants.ACTIVE_SELECTION, selection);
				}
				return true;
			}
		});



Re: E4Application ActiveChild RAT [message #1755888 is a reply to message #1755763] Thu, 09 March 2017 01:41 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 653
Registered: January 2012
Senior Member

Hi Darrel. That code seems to be doing what you're describing. Why do you think it's bad?

Each window maintains an active selection too, which is populated by the out-selection of the active part.

Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:Using e4view still requires class to be IViewPart
Next Topic:TranslationObjectSupplier seems to leak FieldRequestor?
Goto Forum:
  


Current Time: Sun Sep 24 06:58:49 GMT 2017

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

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