package net.wotonomy.test; //import net.wotonomy.foundation.*; import javax.swing.JDialog; import net.wotonomy.ui.EOAssociation; import net.wotonomy.ui.EODisplayGroup; import net.wotonomy.ui.swing.TreeAssociation; import net.wotonomy.ui.swing.util.WindowUtilities; /** * A simple editor panel with a few textfields. */ public class BindingController { public BindingController( EODisplayGroup titlesGroup, EODisplayGroup childGroup ) { BindingPanel bindingPanel = new BindingPanel(); EOAssociation ta; ta = new TreeAssociation( bindingPanel.treeChooser, "People" ); ta.bindAspect( EOAssociation.TitlesAspect, titlesGroup, "lastName" ); ta.bindAspect( EOAssociation.ChildrenAspect, childGroup, "children" ); ta.bindAspect( EOAssociation.IsLeafAspect, titlesGroup, "childCount" ); ta.establishConnection(); JDialog d = new JDialog(); d.getContentPane().add( bindingPanel ); d.setTitle( "Chooser Panel" ); d.pack(); WindowUtilities.cascade( d ); d.show(); } }