| Summary: | Allow generic/DI type instantiation | ||
|---|---|---|---|
| Product: | [Technology] XWT | Reporter: | Erdal Karaca <erdal.karaca.de> |
| Component: | Core | Assignee: | Project Inbox <e4.xwt-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
It should also be possible to inject the named bindings, e.g.:
<Composite x:Class="com.example.MyHandler">
<Button x:Name="myButton" SelectionEvent="handleButton" />
</Composite>
class MyHandler {
@Inject
@Named("myButton")
Button myButton;
void handleButton() {
...
}
}
|
Currently, XWT will instantiate all types internally. It is obvious that instantiating (or being able to instantiate) types through the DI will add extra benefits. XWT could provide a switch to do this or do this automatically when a 'type factory' is provided in the options, e.g.: options.put("XWT.TypeFactory", eclipseContextTypeFactory); XWT.loadWithOptions(options); eclipseContextTypeFactory must provide a mechanism to instantiate a class on its own. For example, this could use the ContextFactory of e4 to instantiate the type...