Search in sources :

Example 1 with InteriorMutationNotifyingBinding

use of org.terasology.nui.databinding.InteriorMutationNotifyingBinding in project Terasology by MovingBlocks.

the class TypeWidgetTestScreen method newBinding.

protected <T> void newBinding(TypeInfo<T> type) {
    Binding<T> binding = new InteriorMutationNotifyingBinding<>(new NotifyingBinding<T>() {

        @Override
        protected void onSet() {
            dumpBindings();
        }
    }, this::dumpBindings);
    bindings.put(type, binding);
    UIWidget bindingWidget = typeWidgetLibrary.getWidget(binding, type).get();
    String bindingLabelText = typeInfoToString(type);
    mainContainer.addWidget(WidgetUtil.labelize(bindingWidget, bindingLabelText, TypeWidgetFactory.LABEL_WIDGET_ID));
}
Also used : InteriorMutationNotifyingBinding(org.terasology.nui.databinding.InteriorMutationNotifyingBinding) UIWidget(org.terasology.nui.UIWidget)

Aggregations

UIWidget (org.terasology.nui.UIWidget)1 InteriorMutationNotifyingBinding (org.terasology.nui.databinding.InteriorMutationNotifyingBinding)1