@Test public void testSetupBindings() { TestView view = new TestView(); TestPmo pmo = new TestPmo(); Binder binder = new Binder(view, pmo); binder.setupBindings(bindingContext); assertThat(pmo.getClickCount(), is(0)); assertThat(pmo.getModel().getClickCount(), is(0)); assertThat(bindingContext.getBindings(), hasSize(2)); assertThat(view.fieldForFieldBinding.getLabelText(), is("")); assertThat(view.fieldForFieldBinding.isEnabled(), is(true)); assertThat(view.fieldForMethodBinding.getLabelText(), is("mod")); assertThat(view.fieldForMethodBinding.isEnabled(), is(false)); assertThat(view.fieldForFieldBinding.getTooltipText(), is(TestPmo.PMO_ATTRIBUTE_TOOLTIP)); assertThat(view.fieldForMethodBinding.getTooltipText(), is(TestPmo.MODEL_ATTRIBUTE_TOOLTIP)); pmo.setModelAttributeEnabled(true); pmo.setModelAttributeTooltip(TestPmo.PMO_ATTRIBUTE_TOOLTIP); bindingContext.modelChanged(); assertThat(view.fieldForMethodBinding.isEnabled(), is(true)); assertThat(view.fieldForMethodBinding.getTooltipText(), is(TestPmo.PMO_ATTRIBUTE_TOOLTIP)); view.fieldForMethodBinding.setEnabled(false); view.fieldForFieldBinding.click(); view.fieldForMethodBinding.click(); view.fieldForMethodBinding.click(); assertThat(pmo.isModelAttributeEnabled(), is(true)); assertThat(pmo.getClickCount(), is(1)); assertThat(pmo.getModel().getClickCount(), is(2)); }
public void setupBindings(BindingContext bindingContext) { addFieldBindings(bindingContext); addMethodBindings(bindingContext); }
Binder { public void setupBindings(BindingContext bindingContext) { addFieldBindings(bindingContext); addMethodBindings(bindingContext); } }
Binder { public void setupBindings(BindingContext bindingContext) { addFieldBindings(bindingContext); addMethodBindings(bindingContext); } Binder(Object view, Object pmo); }
Binder { public void setupBindings(BindingContext bindingContext) { addFieldBindings(bindingContext); addMethodBindings(bindingContext); } Binder(Object view, Object pmo); void setupBindings(BindingContext bindingContext); }
Binder { public void setupBindings(BindingContext bindingContext) { addFieldBindings(bindingContext); addMethodBindings(bindingContext); } Binder(Object view, Object pmo); void setupBindings(BindingContext bindingContext);  }