Search in sources :

Example 1 with Address

use of eu.ggnet.dwoss.customer.ee.entity.Address in project dwoss by gg-net.

the class AddressUpdateController method getAddress.

/**
 * Get the Address back
 */
private Address getAddress() {
    Address a = new Address();
    a.setStreet(street.getText());
    a.setZipCode(zipcode.getText());
    a.setCity(city.getText());
    a.setIsoCountry(countrybox.getSelectionModel().getSelectedItem());
    return a;
}
Also used : Address(eu.ggnet.dwoss.customer.ee.entity.Address)

Example 2 with Address

use of eu.ggnet.dwoss.customer.ee.entity.Address in project dwoss by gg-net.

the class AddressUpdateTryout method main.

public static void main(String[] args) {
    CustomerGenerator gen = new CustomerGenerator();
    Address address = gen.makeAddress();
    JButton close = new JButton("Schliessen");
    close.addActionListener(e -> Ui.closeWindowOf(close));
    JButton editButton = new JButton("Edit");
    editButton.addActionListener(ev -> {
        if (address.getViolationMessage() != null) {
            System.out.println("Address ViolationMessages: " + address.getViolationMessage());
        }
        Ui.exec(() -> {
            Ui.build().fxml().eval(() -> address, AddressUpdateController.class).opt().ifPresent(System.out::println);
        });
    });
    JButton addButton = new JButton("Add");
    addButton.addActionListener(ev -> {
        Ui.exec(() -> {
            Ui.build().fxml().eval(() -> new Address(), AddressUpdateController.class).opt().ifPresent(System.out::println);
        });
    });
    JPanel p = new JPanel();
    p.add(editButton);
    p.add(addButton);
    p.add(close);
    UiCore.startSwing(() -> p);
}
Also used : JPanel(javax.swing.JPanel) Address(eu.ggnet.dwoss.customer.ee.entity.Address) JButton(javax.swing.JButton) CustomerGenerator(eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator)

Example 3 with Address

use of eu.ggnet.dwoss.customer.ee.entity.Address in project dwoss by gg-net.

the class ContactTest method testGetViolationMessagesNonValid2.

@Test
public void testGetViolationMessagesNonValid2() {
    contact.getAddresses().add(new Address());
    assertThat(contact.getViolationMessage()).as("Contact with invalid address").isNotBlank();
}
Also used : Address(eu.ggnet.dwoss.customer.ee.entity.Address) Test(org.junit.Test)

Aggregations

Address (eu.ggnet.dwoss.customer.ee.entity.Address)3 CustomerGenerator (eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1 Test (org.junit.Test)1