Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315173

Summary: di.extensions should work headless
Product: [Eclipse Project] e4 Reporter: Gunnar Wagenknecht <gunnar>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: ob1.eclipse
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
SWT access using reflection none

Description Gunnar Wagenknecht CLA 2010-06-01 03:10:14 EDT
It would be nice to either refactor UI specific extensions into a new bundle (di.extensions.ui) or to make the dependencies on UI code (eg. SWT) optional. This would allow reusing those extensions in a headless environment.
Comment 1 John Arthorne CLA 2010-06-01 11:30:37 EDT
It looks like the dependency just comes from UIEventObjectSupplier. I think this event handler could just be moved somewhere like org.eclipse.ui.workbench.swt rather than creating a new bundle for it. What do you think Oleg?
Comment 2 Oleg Besedin CLA 2010-06-02 13:44:11 EDT
(In reply to comment #1)
> org.eclipse.ui.workbench.swt

You mean "org.eclipse.e4.ui.workbench.swt" ? That bundle depends on org.eclipse.e4.ui.workbench.

The better place would be something on e4-JFace level, but we don't have such bundles at the moment. Plus UIEventObjectSupplier needs internal EventObjectSupplier (which can be worked around via x-friends - if we need to).

I'd rather move UIEventTopic/UIEventObjectSupplier into a separate package ("org.eclipse.e4.core.di.extensions"?) in its current bundle and mark SWT dependency as optional.
Comment 3 Oleg Besedin CLA 2010-06-02 13:48:28 EDT
(In reply to comment #2)
> ("org.eclipse.e4.core.di.extensions"?)

That should have been "org.eclipse.e4.core.di.extensions.ui".
Comment 4 Gunnar Wagenknecht CLA 2010-06-02 13:59:08 EDT
Created attachment 170851 [details]
SWT access using reflection

What about also using reflection? I hacked a quick idea together. This would allow compiling without SWT.
Comment 5 Oleg Besedin CLA 2010-06-03 15:50:33 EDT
Fixed as a part of bug 315325.

*** This bug has been marked as a duplicate of bug 315325 ***