Package org.axonframework.examples.addressbook.vaadin.data

Examples of org.axonframework.examples.addressbook.vaadin.data.ContactFormBean


    /**
     * Setup the form to create a new Contact
     */
    public void addContact() {
        setItemDataSource(new BeanItem<ContactFormBean>(new ContactFormBean()));
        newContactMode = true;
        setReadOnly(false);
    }
View Full Code Here


        setReadOnly(false);
    }

    private void handleDelete() {
        setReadOnly(true);
        ContactFormBean contact = obtainContactFormBeanFromDatasource();
        RemoveContactCommand command = new RemoveContactCommand();
        command.setContactId(contact.getIdentifier());
        commandBus.dispatch(new GenericCommandMessage<Object>(command));
        String message = "Removed the contact with name " + contact.getName();
        fireEvent(new FormIsSuccessfullyCommittedEvent(this));
        getApplication().getMainWindow().showNotification(message, Window.Notification.TYPE_TRAY_NOTIFICATION);
    }
View Full Code Here

        if (!isValid()) {
            return;
        }

        AbstractOrderCommand command;
        ContactFormBean contact = obtainContactFormBeanFromDatasource();

        if (newContactMode) {
            newContactMode = false;
            CreateContactCommand createCommand = new CreateContactCommand();
            createCommand.setNewContactName(contact.getName());
            command = createCommand;
            message = "Created new contact with name " + contact.getName();
        } else {
            ChangeContactNameCommand changeCommand = new ChangeContactNameCommand();
            changeCommand.setContactNewName(contact.getName());
            changeCommand.setContactId(contact.getIdentifier());
            command = changeCommand;
            message = "Changed name of contact into " + contact.getName();
        }
        commandBus.dispatch(new GenericCommandMessage<Object>(command));
        fireEvent(new FormIsSuccessfullyCommittedEvent(this));
        setReadOnly(true);
        getApplication().getMainWindow().showNotification(message, Window.Notification.TYPE_TRAY_NOTIFICATION);
View Full Code Here

         *
         * @param source the source component of the event
         */
        public FormIsSuccessfullyCommittedEvent(Component source) {
            super(source);
            ContactFormBean contactFormBean = obtainContactFormBeanFromDatasource();
            name = contactFormBean.getName();
            identifier = contactFormBean.getIdentifier();
        }
View Full Code Here

    public void valueChange(Property.ValueChangeEvent event) {
        Property property = event.getProperty();
        if (property == contactList) {
            @SuppressWarnings({"unchecked"})
            ContactEntry item = ((BeanItem<ContactEntry>) contactList.getItem(contactList.getValue())).getBean();
            ContactFormBean contactFormBean = new ContactFormBean(item.getIdentifier(), item.getName());
            contactForm.setItemDataSource(new BeanItem<ContactFormBean>(contactFormBean));
        }
    }
View Full Code Here

TOP

Related Classes of org.axonframework.examples.addressbook.vaadin.data.ContactFormBean

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.