blob: be83eb438142a04539672981a75b6b6c85c5aa2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
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();
}
}
|