use of org.terasology.nui.reflection.WidgetLibrary in project Terasology by MovingBlocks.
the class NUIManagerInternal method refreshWidgetsLibrary.
public void refreshWidgetsLibrary() {
widgetsLibrary = new WidgetLibrary(context.get(ModuleManager.class).getEnvironment(), context.get(ReflectFactory.class), context.get(CopyStrategyLibrary.class));
ModuleEnvironment environment = context.get(ModuleManager.class).getEnvironment();
for (Class<? extends UIWidget> type : environment.getSubtypesOf(UIWidget.class)) {
Name module = verifyNotNull(environment.getModuleProviding(type), "No module provides %s", type);
widgetsLibrary.register(new ResourceUrn(module.toString(), type.getSimpleName()), type);
}
}
Aggregations