Changeset 1883
- Timestamp:
- 05/14/09 14:51:02 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jmatter-complet/trunk/demo-apps/ContactMgr/src/com/u2d/contactmgr/NewPersonWizard.java
r1 r1883 2 2 3 3 import com.u2d.wizard.details.*; 4 import com.u2d. type.composite.*;4 import com.u2d.view.swing.FormView; 5 5 import com.u2d.model.ComplexType; 6 import com.u2d.view.swing.FormView; 6 7 7 import javax.swing.*; 8 8 9 9 public class NewPersonWizard extends CompositeStep 10 10 { 11 private Name _name; 12 private USAddress _address; 13 private Contact _contact; 11 private PersonContact pc; 14 12 15 13 public NewPersonWizard() 16 14 { 17 15 super("New Person Wizard"); 18 createObjects();16 pc = (PersonContact) ComplexType.forClass(PersonContact.class).instance(); 19 17 setupSteps(); 20 }21 22 private void createObjects()23 {24 _name = (Name) ComplexType.forClass(Name.class).instance();25 _address = (USAddress) ComplexType.forClass(USAddress.class).instance();26 _contact = (Contact) ComplexType.forClass(Contact.class).instance();27 18 } 28 19 … … 47 38 public JComponent getView() 48 39 { 49 return new FormView( _name);40 return new FormView(pc.getName()); 50 41 } 51 42 } … … 56 47 public JComponent getView() 57 48 { 58 return new FormView( _address);49 return new FormView(pc.getContact().getAddress()); 59 50 } 60 51 } … … 65 56 public JComponent getView() 66 57 { 67 return new FormView( _contact);58 return new FormView(pc.getContact()); 68 59 } 69 60 70 61 public void commit() 71 62 { 72 PersonContact pc = new PersonContact();73 pc.getName().setValue(_name);74 pc.getContact().setValue(_contact);75 pc.getContact().getAddress().setValue(_address);76 63 pc.save(); 77 64 } jmatter-complet/trunk/demo-apps/ContactMgr/src/com/u2d/contactmgr/PersonContact.java
r1838 r1883 20 20 public static Wizard NewPersonWizard(CommandInfo cmdInfo) 21 21 { 22 // was:23 //return new Wizard(new NewPersonWizard());22 // basic: 23 return new Wizard(new NewPersonWizard()); 24 24 25 25 // New Alternative: … … 31 31 32 32 // Third alternative, using Groovy Builder for JMatter Wizards: 33 return PersonWizardBuilder.wizard();33 // return PersonWizardBuilder.wizard(); 34 34 } 35 35
