Last active
February 13, 2016 19:34
-
-
Save baldram/b05cb07af90d549e45d9 to your computer and use it in GitHub Desktop.
Client-Side Bean Manager. Example of looking up beans through the use of the lookupBeans() method implemented in generic way. Example usage: SomeViewType mapView = getView(SomeViewType.class);More here: http://docs.jboss.org/errai/3.2.2.Final/errai/reference/html_single/#d0e3223
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
private SyncBeanManager manager; | |
public <T extends Composite> T getView(Class<T> type) { | |
T view = null; | |
IOCBeanDef<T> bean = manager.lookupBean(type); | |
if (bean != null) { | |
view = bean.getInstance(); | |
} | |
return view; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment