コード例 #1
0
  private BindingContext bindingContextOfThrowingExceptionWhenRetrievingPropertyValueModel() {
    when(bindingContext.getPropertyValueModel(anyString())).thenThrow(new RuntimeException());
    when(bindingContext.getReadOnlyPropertyValueModel(anyString()))
        .thenThrow(new RuntimeException());
    when(bindingContext.getDataSetPropertyValueModel(anyString()))
        .thenThrow(new RuntimeException());

    return bindingContext;
  }
コード例 #2
0
  private void bindAttribute(boolean twoWayBinding, boolean preInitializeView) {
    if (twoWayBinding)
      when(bindingContext.<Integer>getPropertyValueModel(PROPERTY_NAME)).thenReturn(valueModel);
    else
      when(bindingContext.<Integer>getReadOnlyPropertyValueModel(PROPERTY_NAME))
          .thenReturn(valueModel);

    when(bindingContext.shouldPreInitializeViews()).thenReturn(preInitializeView);

    if (preInitializeView) {
      attribute.preInitializeView(bindingContext);
    }
    attribute.bindTo(bindingContext);
  }
コード例 #3
0
 @Override
 public void bindTo(BindingContext bindingContext) {
   SubViewBinder viewBinder = bindingContext.createSubViewBinder();
   View subView = viewBinder.inflateAndBind(layoutId, attribute.getPropertyName());
   subViewHolder.setSubView(subView);
 }