Package com.petrituononen.customerdb.jaxb

Examples of com.petrituononen.customerdb.jaxb.Address


   * @param town
   * @return Address
   */
  public static Address createAddress(String type, String street1,
      String street2, String postalCode, String town) {
    Address address = factory.createAddress();
    address.setType(type);
    address.getStreet().add(street1);
    address.getStreet().add(street2);
    address.setPostalCode(postalCode);
    address.setTown(town);
   
    return address;
  }
View Full Code Here


   * Fill Customer element's data to form's fields.
   * @param cust
   */
  private void fillFields(Customer cust) {
    txtName.setText(cust.getName());
    Address address = cust.getAddress();
    txtStreet1.setText(address.getStreet().get(0));
    txtStreet2.setText(address.getStreet().get(1));
    txtPostalCode.setText(address.getPostalCode());
    txtTown.setText(address.getTown());
    List<Object> emailsAndPhones = cust.getEmailOrPhone();
    Phone phone = null;
    Email email = null;
    for(Object obj : emailsAndPhones) {
      if (obj instanceof Phone) {
View Full Code Here

  /**
   * Create Customer object from the data of form's fields.
   * @return Customer object
   */
  private Customer formCustomerFromFields() {
    Address address = CustomerListManager.createAddress(ADDRESS_TYPE, txtStreet1.getText(),
        txtStreet2.getText(), txtPostalCode.getText(), txtTown.getText());
    Phone work = CustomerListManager.createPhone(PHONE_WORK, txtPhoneWork.getText());
    Phone mobile = CustomerListManager.createPhone(PHONE_MOBILE, txtPhoneMobile.getText());
    Email email = CustomerListManager.createEmail(EMAIL_WORK, txtEmail.getText());
    Customer cust = CustomerListManager.createCustomer(txtName.getText(), address, work,
View Full Code Here

TOP

Related Classes of com.petrituononen.customerdb.jaxb.Address

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.