PersonalInfoPanel.java
001 package org.cafesip.gwtcomp.examples.client;
002 
003 import org.cafesip.gwtcomp.client.ui.DataEntryPanel;
004 import org.cafesip.gwtcomp.client.ui.MessageBar;
005 import org.cafesip.gwtcomp.client.ui.TitleBar;
006 import org.cafesip.gwtcomp.client.ui.WizardPanel;
007 
008 import com.google.gwt.user.client.ui.Button;
009 import com.google.gwt.user.client.ui.Label;
010 import com.google.gwt.user.client.ui.ListBox;
011 import com.google.gwt.user.client.ui.TextArea;
012 import com.google.gwt.user.client.ui.TextBox;
013 
014 public class PersonalInfoPanel extends DataEntryPanel
015 {
016     private WizardPanel parent;
017     private TextBox name = new TextBox();
018     private TextBox email = new TextBox();
019     private TextArea address = new TextArea();
020     private ListBox cities = new ListBox();
021     private ListBox counties = new ListBox();
022     
023     
024     public PersonalInfoPanel(WizardPanel parent)
025     {
026         this.parent = parent;
027 
028         setTitleBar(new TitleBar("Personal Information", null, 2));
029      
030         // I am part of a wizard panel. I dont need a message bar. The message
031         // bar is only needed for standalone data entry panels.
032         // Uncomment the line below to see the message bar
033         MessageBar mbar = new MessageBar();
034         // setMessageBar(mbar);
035         
036         name.setName("name");
037         addField(new Label("Name"), name, true);
038         
039         email.setName("email");
040         addField(new Label("Email"), email, true);
041         
042         address.setName("address");
043         addField(new Label("Address"), address);
044         
045         cities.addItem("Raleigh");
046         cities.addItem("Durham");
047         cities.addItem("Apex");
048         cities.addItem("Chapel Hill");
049         
050         cities.setName("city");
051         addField(new Label("City"), cities);
052         
053         addField(new Label("OR"));
054         
055         counties.addItem("Wake");
056         counties.addItem("Durham");
057         counties.addItem("Orange");
058         
059         counties.setName("county");
060         addField(new Label("County"), counties);
061         
062         Button okButton = new Button("Apply");
063         Button cancelButton = new Button("Cancel");
064         getButtonBar().addButton(okButton);
065         getButtonBar().addButton(cancelButton);
066         
067         // since I am part of the wizard panel, make me invisible.
068         // If you want to see the buttons, comment out the line below
069         getButtonBar().setVisible(false);
070     }
071 
072 
073     /**
074      @return Returns the address.
075      */
076     public TextArea getAddress()
077     {
078         return address;
079     }
080 
081 
082     /**
083      @return Returns the cities.
084      */
085     public ListBox getCities()
086     {
087         return cities;
088     }
089 
090 
091     /**
092      @return Returns the email.
093      */
094     public TextBox getEmail()
095     {
096         return email;
097     }
098 
099 
100     /**
101      @return Returns the name.
102      */
103     public TextBox getName()
104     {
105         return name;
106     }
107 
108 
109     /**
110      @return Returns the counties.
111      */
112     public ListBox getCounties()
113     {
114         return counties;
115     }
116 
117 }