Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » SWT - Creating child context in ShellActivationListener(i.e. who should be the parent for opening shell's context)
SWT - Creating child context in ShellActivationListener [message #1745776] Mon, 17 October 2016 13:15
Andrzej Witecki is currently offline Andrzej WiteckiFriend
Messages: 2
Registered: November 2015
Junior Member
In E4 apps based on PartRenderingEngine every activated shell is being handled by ShellActivationListener. This listener binds proper context to the activated Shell. Everything seems to be logical in case of MWindow related Shells but when "regular" Shell (e.g. progress dialog) is being activated then listener binds it to the context created as a child of MApplication context and activates this context (see ShellActivationListener#activate for details).

Due to this solution we cannot fully operate using UI-based-dependencies (e.g. PartServiceImpl) stored within window's context when the operation is triggered from such "regular" Shell. This is misleading as the Shell is created within running UI of E4 app.

Real example:
1. Create long-run operation which opens proper editor in the end
2. Run this operation using IProgressService#runInUI
3. Operation fails in the end because EPartService was resolved from activated non-UI context (created using MApplication), i.e. we got ApplicationPartService instead of PartServiceImpl

Wouldn't it be rational to use application.getContext().getActiveChild() as a parent context in ShellActivationListener#activate? I cannot find any counterarguments for that at this moment.

Andrzej
Previous Topic:EHelpService
Next Topic:SWT Browser
Goto Forum:
  


Current Time: Fri Apr 26 09:02:25 GMT 2024

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

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

Back to the top