use of org.terasology.engine.rendering.nui.widgets.types.object.SubtypeLayoutBuilder in project Terasology by MovingBlocks.
the class TypeWidgetLibraryImpl method getBaseTypeWidget.
@Override
public <T> Optional<UIWidget> getBaseTypeWidget(Binding<T> binding, TypeInfo<T> baseType) {
try (ModuleContext.ContextSpan ignored = ModuleContext.setContext(contextModule)) {
if (Primitives.isWrapperType(baseType.getRawType()) || baseType.getRawType().isPrimitive()) {
return getWidget(binding, baseType);
}
ModuleManager moduleManager = context.get(ModuleManager.class);
TypeRegistry typeRegistry = context.get(TypeRegistry.class);
SubtypeLayoutBuilder<T> builder = new SubtypeLayoutBuilder<>(baseType, this, moduleManager, typeRegistry);
return Optional.of(builder.build(binding));
}
}
Aggregations