Bug 420491: Code Type generic type

https://bugs.eclipse.org/bugs/show_bug.cgi?id=420491

Generics and API adjustments.
Backport Bugfix Invalid Thread access for SWT apps.