Package org.izi.binding.Binding

Examples of org.izi.binding.Binding.BindingRegistration.unbind()


      BindingRegistration reg = bind().valueOf(model, ModelForTests.FULL_NAME).after(ModelForTests.NAME, ModelForTests.SURNAME).to(output, ModelForTests.NAME);
      model.setName("John");
      model.setSurname("Smith");
      assertEquals("John Smith", output.getName());

      reg.unbind();
      // when
      model.setName("Jane");
      model.setSurname("Doe");
      // then
      assertEquals("John Smith", output.getName());
View Full Code Here


      }).to(output, ModelForTests.NAME);
      model.setName("John");
      model.setSurname("Smith");
      assertEquals("John Smith", output.getName());
      // when
      to.unbind();
      model.setName("Jane");
      model.setSurname("Doe");
      // then
      assertEquals("John Smith", output.getName());
   }
View Full Code Here

      // given
      JTextField textField = new JTextField();
      ModelForTests model = new ModelForTests();
      BindingRegistration bindingRegistration = bind().valueOf(model, ModelForTests.NAME).toTextOf(textField);
      model.setName("ABC123");
      bindingRegistration.unbind();
      // when
      model.setName("SomeOtherValue");
      // then
      assertEquals("ABC123", textField.getText());
   }
View Full Code Here

      // given
      JTextField textField = new JTextField();
      ModelForTests model = new ModelForTests();
      BindingRegistration to = bind().textOf(textField).to(model, ModelForTests.NAME);
      textField.setText("newData");
      to.unbind();
      // when
      textField.setText("someOtherText");
      // then
      assertEquals("newData", model.getName());
   }
View Full Code Here

      JCheckBox checkBox = new JCheckBox();
      BindingRegistration reg = bind().selectedOf(checkBox).to(model, ModelForTests.SELECTED);
      checkBox.setSelected(true);
      assertEquals(Boolean.TRUE, model.getSelected());

      reg.unbind();
      // when
      checkBox.setSelected(false);
      // then
      assertEquals(Boolean.TRUE, model.getSelected());
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.