Search in sources :

Example 1 with DataSetValueModel

use of org.robobinding.property.DataSetValueModel in project RoboBinding by RoboBinding.

the class BindingContext method navigateToItemContext.

public ItemBindingContext navigateToItemContext(String propertyName) {
    DataSetValueModel valueModel = presentationModelAdapter.getDataSetPropertyValueModel(propertyName);
    boolean itemPreInitializeViews = valueModel.preInitializingViewsWithDefault(preInitializeViews.defaultValue);
    return new ItemBindingContext(new ItemBinderFactory(binderProvider, createBindingContextFactory(preInitializeViews.withValue(itemPreInitializeViews))), valueModel, itemPreInitializeViews);
}
Also used : DataSetValueModel(org.robobinding.property.DataSetValueModel)

Example 2 with DataSetValueModel

use of org.robobinding.property.DataSetValueModel in project RoboBinding by RoboBinding.

the class BindingContextTest method shouldItemBindingContextWithExpectedPreInitializeViews.

@Test
public void shouldItemBindingContextWithExpectedPreInitializeViews() {
    boolean expectedPreInitializeViews = RandomValues.trueOrFalse();
    String propertyName = "pName";
    DataSetValueModel dataSetProperty = mock(DataSetValueModel.class);
    when(dataSetProperty.preInitializingViewsWithDefault(anyBoolean())).thenReturn(expectedPreInitializeViews);
    PresentationModelAdapter presentationModelAdapter = aPresentationModelAdapterWithDataSetProperty(propertyName, dataSetProperty);
    BindingContext context = newBindingContext(presentationModelAdapter);
    ItemBindingContext itemBindingContext = context.navigateToItemContext(propertyName);
    assertThat(itemBindingContext.shouldPreInitializeViews(), is(expectedPreInitializeViews));
}
Also used : DataSetValueModel(org.robobinding.property.DataSetValueModel) PresentationModelAdapter(org.robobinding.presentationmodel.PresentationModelAdapter) Test(org.junit.Test)

Aggregations

DataSetValueModel (org.robobinding.property.DataSetValueModel)2 Test (org.junit.Test)1 PresentationModelAdapter (org.robobinding.presentationmodel.PresentationModelAdapter)1