Ladies_Man

claim legal info form

Mar 31st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.42 KB | None | 0 0
  1. package ru.pochta.abon.ui.component;
  2.  
  3.  
  4. import com.vaadin.ui.TextField;
  5. import org.springframework.context.MessageSource;
  6. import ru.pochta.abon.container.Container;
  7. import ru.pochta.abon.library.dto.abonClient.dto.Claim;
  8. import ru.pochta.abon.library.service.abonClient.ServiceManager;
  9.  
  10. public class ClaimLegalInfoForm extends ClaimInfoForm {
  11.  
  12.     public ClaimLegalInfoForm (Container container, ServiceManager serviceManager, MessageSource messageSource, Claim claim) {
  13.         super(container, serviceManager, messageSource, claim);
  14.     }
  15.  
  16.     void createForm() {
  17.  
  18.         ClaimIndividualInfoForm individualForm = new ClaimIndividualInfoForm(container, serviceManager, messageSource, claim);
  19.  
  20.         this.leftCol = individualForm.leftCol;
  21.         this.rightCol = individualForm.rightCol;
  22.  
  23.         TextField orgName = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.orgName", null, locale));
  24.         orgName.setValue(null != client.getOrgName() ? client.getOrgName() : "");
  25.         rightCol.addComponent(orgName);
  26.  
  27.         TextField inn = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.inn", null, locale));
  28.         inn.setValue(null != client.getInn() ? client.getInn() : "");
  29.         rightCol.addComponent(inn);
  30.  
  31.         TextField kpp = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.kpp", null, locale));
  32.         kpp.setValue(null != client.getKpp() ? client.getKpp() : "");
  33.         rightCol.addComponent(kpp);
  34.  
  35.  
  36.  
  37.  
  38.         TextField bankName = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.bankName", null, locale));
  39.         bankName.setValue(null != client.getBankName() ? client.getBankName() : "");
  40.         leftCol.addComponent(bankName);
  41.  
  42.         TextField accountNumber = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.accountNumber", null, locale));
  43.         accountNumber.setValue(null != client.getAccountNumber() ? client.getAccountNumber() : "");
  44.         leftCol.addComponent(accountNumber);
  45.  
  46.         TextField correspondenceNumber = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.correspondenceNumber", null, locale));
  47.         correspondenceNumber.setValue(null != client.getCorrespondentNumber() ? client.getCorrespondentNumber() : "");
  48.         leftCol.addComponent(correspondenceNumber);
  49.  
  50.         TextField bik = new TextField(messageSource.getMessage("claimsTab.ClaimInfoWindow.bik", null, locale));
  51.         bik.setValue(null != client.getBankBik() ? client.getBankBik() : "");
  52.         leftCol.addComponent(bik);
  53.  
  54.  
  55.  
  56.         //here are some minor fixes for common fields
  57.         TextField regAddress = individualForm.getAddressReg();
  58.         regAddress.setCaption(messageSource.getMessage("claimsTab.ClaimInfoWindow.legal.legalAddress", null, locale));
  59.         regAddress.setValue(null != client && null != client.getAddressLegal() ? client.getAddressLegal() : "");
  60.  
  61.         TextField factAddress = individualForm.getAddressFact();
  62.         factAddress.setCaption(messageSource.getMessage("claimsTab.ClaimInfoWindow.legal.factAddress", null, locale));
  63.         factAddress.setValue(null != client && null != client.getAddressFact() ? client.getAddressFact() : "");
  64.  
  65.         TextField contactPerson = individualForm.getClientName();
  66.         contactPerson.setCaption(messageSource.getMessage("claimsTab.ClaimInfoWindow.legal.contactPerson", null, locale));
  67.  
  68.  
  69.         this.addComponent(individualForm);
  70.     }
  71. }
Add Comment
Please, Sign In to add comment