use of eu.ggnet.dwoss.customer.ui.neo.PreferedAddressLabelsController.InvoiceAddressLabelWithNullableShippingAddressLabel in project dwoss by gg-net.
the class PreferedAddressLabelsController method handleSaveButtonAction.
@FXML
private void handleSaveButtonAction(ActionEvent event) {
Company invoiceLabelCompany = invoiceAddressCompanyListView.getSelectionModel().getSelectedItem();
Contact invoiceLabelContact = invoiceAddressContactListView.getSelectionModel().getSelectedItem();
Address invoiceLabelAddress = invoiceAddressAddressListView.getSelectionModel().getSelectedItem();
AddressLabel invoiceLabel = new AddressLabel(invoiceLabelCompany, invoiceLabelContact, invoiceLabelAddress, AddressType.INVOICE);
Address shippingAddress = shippingAddressAddressListView.getSelectionModel().getSelectedItem();
Company shippingLabelCompany = shippingAddressCompanyListView.getSelectionModel().getSelectedItem();
Contact shippingLabelContact = shippingAddressContactListView.getSelectionModel().getSelectedItem();
AddressLabel shippingLabel;
if (shippingAddress == null || (shippingLabelCompany == null && shippingLabelContact == null))
shippingLabel = null;
else
shippingLabel = new AddressLabel(shippingLabelCompany, invoiceLabelContact, shippingAddress, SHIPPING);
this.resultAdressLabel = new InvoiceAddressLabelWithNullableShippingAddressLabel(shippingLabel, invoiceLabel);
Ui.closeWindowOf(saveButton);
}
Aggregations