Bug 332386 - Allow generic/DI type instantiation
Summary: Allow generic/DI type instantiation
Status: NEW
Alias: None
Product: XWT
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-12 02:50 EST by Erdal Karaca CLA
Modified: 2013-01-24 15:32 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erdal Karaca CLA 2010-12-12 02:50:04 EST
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...
Comment 1 Erdal Karaca CLA 2010-12-12 03:17:16 EST
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() {
  ...
  }
}