Changeset 1883

Show
Ignore:
Timestamp:
05/14/09 14:51:02 (3 years ago)
Author:
eitan
Message:

slightly simpler/improved demo wizard in contactmgr demoapp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jmatter-complet/trunk/demo-apps/ContactMgr/src/com/u2d/contactmgr/NewPersonWizard.java

    r1 r1883  
    22 
    33import com.u2d.wizard.details.*; 
    4 import com.u2d.type.composite.*
     4import com.u2d.view.swing.FormView
    55import com.u2d.model.ComplexType; 
    6 import com.u2d.view.swing.FormView; 
     6 
    77import javax.swing.*; 
    88 
    99public class NewPersonWizard extends CompositeStep 
    1010{ 
    11    private Name _name; 
    12    private USAddress _address; 
    13    private Contact _contact; 
     11   private PersonContact pc; 
    1412 
    1513   public NewPersonWizard() 
    1614   { 
    1715      super("New Person Wizard"); 
    18       createObjects(); 
     16      pc = (PersonContact) ComplexType.forClass(PersonContact.class).instance(); 
    1917      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(); 
    2718   } 
    2819 
     
    4738      public JComponent getView() 
    4839      { 
    49          return new FormView(_name); 
     40         return new FormView(pc.getName()); 
    5041      } 
    5142   } 
     
    5647      public JComponent getView() 
    5748      { 
    58          return new FormView(_address); 
     49         return new FormView(pc.getContact().getAddress()); 
    5950      } 
    6051   } 
     
    6556      public JComponent getView() 
    6657      { 
    67          return new FormView(_contact); 
     58         return new FormView(pc.getContact()); 
    6859      } 
    6960 
    7061      public void commit() 
    7162      { 
    72          PersonContact pc = new PersonContact(); 
    73          pc.getName().setValue(_name); 
    74          pc.getContact().setValue(_contact); 
    75          pc.getContact().getAddress().setValue(_address); 
    7663         pc.save(); 
    7764      } 
  • jmatter-complet/trunk/demo-apps/ContactMgr/src/com/u2d/contactmgr/PersonContact.java

    r1838 r1883  
    2020   public static Wizard NewPersonWizard(CommandInfo cmdInfo) 
    2121   { 
    22       // was
    23 //       return new Wizard(new NewPersonWizard()); 
     22      // basic
     23       return new Wizard(new NewPersonWizard()); 
    2424       
    2525      // New Alternative: 
     
    3131       
    3232      // Third alternative, using Groovy Builder for JMatter Wizards: 
    33       return PersonWizardBuilder.wizard(); 
     33//      return PersonWizardBuilder.wizard(); 
    3434   } 
    3535