Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[e4-dev] Using DI in a XWT EventHandler

Hi,

we're using XWT in our E4 application which works pretty good. The only problem is to get DI work in the EventHandler class we are using.

Setup looks like the following:
SomeGuiPart -> uses @PostConstruct to load XWT file and setup some fields in it
SomeGuiEventHandler -> is referenced from the XWT file usingĀ x:Class="...SomeGuiEventHandler"


The problem now is, that SomeGuiEventHandler is not part of the application model and of that no DI is available. Sadly I also don't see a way to
a) access the Eclipse context from the event handler, or
b) access the SomeGuiPart instance from the event handler, or
c) create the event handler instance in the SomeGuiPart and pass it to the XWT instance

So, the only solution I see is to handle the XWT events in the part class which is a part of the application model.

Are there better options to handle events in a separate class?

Greetings
Ben

Back to the top