Package sk.vrto.web.views

Examples of sk.vrto.web.views.ContactView


public class ContactViewProvider implements ApplicationContextAware {

    private ApplicationContext applicationContext;

    public ContactView get(Contact contact) {
        ContactView view = new ContactView(applicationContext.getBean(ContactPresenter.class));
        view.setContact(contact);
        view.init();

        return view;
    }
View Full Code Here


    @Subscribe
    public void onContactRemoved(ContactRemovedEvent e) {
        String email = e.getRemovedContact();
        Iterator<com.vaadin.ui.Component> componentIterator = view.getComponentIterator();
        while (componentIterator.hasNext()) {
            ContactView contactView = (ContactView) componentIterator.next();
            if (contactView.getContact().getEmail().equals(email)) {
                this.view.removeComponent(contactView);
                break;
            }
        }
    }
View Full Code Here

    @Subscribe
    public void onContactUpdated(ContactUpdatedEvent e) {
        Contact contact = e.getUpdatedContact();
        Iterator<com.vaadin.ui.Component> componentIterator = view.getComponentIterator();
        while (componentIterator.hasNext()) {
            ContactView contactView = (ContactView) componentIterator.next();
            if (contactView.getContact().getEmail().equals(contact.getEmail())) {
                int index = view.getComponentIndex(contactView);
                view.removeComponent(contactView);
                view.addComponent(contactViewProvider.get(contact), index);
                break;
            }
View Full Code Here

TOP

Related Classes of sk.vrto.web.views.ContactView

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.