Package org.jdesktop.beansbinding

Examples of org.jdesktop.beansbinding.AutoBinding


                BindingGroup bg = new BindingGroup();
                bpromos = SwingBindings.createJListBinding(AutoBinding.UpdateStrategy.READ,
                        GestionPromotion.getInstance().getPromotions(), l_promos);
                bg.addBinding(bpromos);

                AutoBinding btextpromo = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, l_promos,
                        (Property) BeanProperty.create("selectedElement.libelle"), tb_libelle_promo, (Property) BeanProperty.create("text"));
                bg.addBinding(btextpromo);
                btextpromo.setSourceUnreadableValue("");

                belves = SwingBindings.createJTableBinding(AutoBinding.UpdateStrategy.READ_WRITE, l_promos, (Property) BeanProperty.create("selectedElement.eleves"), t_eleves);
                belves.addColumnBinding(BeanProperty.create("nom")).setColumnName("Nom").setEditable(false).setColumnClass(String.class);
                belves.addColumnBinding(BeanProperty.create("prenom")).setColumnName("Prénom").setEditable(false).setColumnClass(String.class);
                belves.addColumnBinding(BeanProperty.create("email")).setColumnName("Email").setEditable(false).setColumnClass(String.class);
                belves.addColumnBinding(BeanProperty.create("num")).setColumnName("Numéro").setEditable(false).setColumnClass(String.class);
                bg.addBinding(belves);

                AutoBinding nom_e = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_WRITE, t_eleves,
                        (Property) BeanProperty.create("selectedElement.nom"), tb_nom_eleve, (Property) BeanProperty.create("text"));
                nom_e.setSourceUnreadableValue("");
                AutoBinding prenom_e = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, t_eleves,
                        (Property) BeanProperty.create("selectedElement.prenom"), tb_prenom_eleve, (Property) BeanProperty.create("text"));
                prenom_e.setSourceUnreadableValue("");
                AutoBinding email_e = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, t_eleves,
                        (Property) BeanProperty.create("selectedElement.email"), tb_email_eleve, (Property) BeanProperty.create("text"));
                email_e.setSourceUnreadableValue("");
                AutoBinding num_e = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, t_eleves,
                        (Property) BeanProperty.create("selectedElement.num"), tb_num_eleve, (Property) BeanProperty.create("text"));
                num_e.setSourceUnreadableValue("");

                bg.addBinding(nom_e);
                bg.addBinding(prenom_e);
                bg.addBinding(email_e);
                bg.addBinding(num_e);
View Full Code Here


  public WrappedBinding addWrappedBinding(Object source, String sourceProperty, JComponent component, String componentProperty) {
    return addWrappedBinding(JBindings.bind(source, sourceProperty, component, componentProperty));
  }
 
  public AutoBinding bind(UpdateStrategy updateStrategy, Object source, String sourceProperty, Object target, String targetProperty) {
    AutoBinding binding = Bindings.createAutoBinding(
        updateStrategy,
        source,
        BeanProperty.create(sourceProperty),
        target,
        BeanProperty.create(targetProperty));
    binding.bind();
    return binding;
  }
View Full Code Here

TOP

Related Classes of org.jdesktop.beansbinding.AutoBinding

Copyright © 2018 www.massapicom. 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.