Example usage for com.vaadin.ui VerticalLayout VerticalLayout

List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout VerticalLayout.

Prototype

public VerticalLayout() 

Source Link

Document

Constructs an empty VerticalLayout.

Usage

From source file:com.esofthead.mycollab.mobile.module.crm.ui.CrmPreviewFormControlsGenerator.java

License:Open Source License

public CrmPreviewFormControlsGenerator(final AdvancedPreviewBeanForm<T> editForm) {
    this.previewForm = editForm;

    editButtons = new VerticalLayout();
    editButtons.setSpacing(true);/*from   w w w. j  av a  2s  . co m*/
    editButtons.setWidth("100%");
    editButtons.setMargin(true);
    editButtons.addStyleName("edit-btn-layout");
}

From source file:com.esofthead.mycollab.mobile.module.crm.ui.NotesList.java

License:Open Source License

private void initUI() {
    noteList = new BeanList<NoteService, NoteSearchCriteria, SimpleNote>(noteService,
            NoteRowDisplayHandler.class);
    noteList.setDisplayEmptyListText(false);
    noteList.setStyleName("noteList");

    noteListContainer = new VerticalLayout();
    this.setContent(noteListContainer);
    displayNotes();//from w ww  .  j a  v  a  2 s  .co  m

    HorizontalLayout commentBox = new HorizontalLayout();
    commentBox.setSizeFull();
    commentBox.setStyleName("comment-box");
    commentBox.setSpacing(true);
    commentBox.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    final TextArea noteInput = new TextArea();
    noteInput.setInputPrompt(AppContext.getMessage(GenericI18Enum.M_NOTE_INPUT_PROMPT));
    noteInput.setSizeFull();
    commentBox.addComponent(noteInput);
    commentBox.setExpandRatio(noteInput, 1.0f);

    Button postBtn = new Button(AppContext.getMessage(GenericI18Enum.M_BUTTON_SEND));
    postBtn.setStyleName("submit-btn");
    postBtn.setWidthUndefined();
    postBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -5095455325725786794L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            final Note note = new Note();
            note.setCreateduser(AppContext.getUsername());
            note.setNote(noteInput.getValue());
            note.setSaccountid(AppContext.getAccountId());
            note.setSubject("");
            note.setType(type);
            note.setTypeid(typeid);
            note.setCreatedtime(new GregorianCalendar().getTime());
            note.setLastupdatedtime(new GregorianCalendar().getTime());
            noteService.saveWithSession(note, AppContext.getUsername());

            // Save Relay Email -- having time must refact to
            // Aop
            // ------------------------------------------------------
            RelayEmailNotification relayNotification = new RelayEmailNotification();
            relayNotification.setChangeby(AppContext.getUsername());
            relayNotification.setChangecomment(noteInput.getValue());
            relayNotification.setSaccountid(AppContext.getAccountId());
            relayNotification.setType(type);
            relayNotification.setAction(MonitorTypeConstants.ADD_COMMENT_ACTION);
            relayNotification.setTypeid("" + typeid);
            if (type.equals(CrmTypeConstants.ACCOUNT)) {
                relayNotification.setEmailhandlerbean(AccountRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.CONTACT)) {
                relayNotification.setEmailhandlerbean(ContactRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.CAMPAIGN)) {
                relayNotification.setEmailhandlerbean(CampaignRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.LEAD)) {
                relayNotification.setEmailhandlerbean(LeadRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.OPPORTUNITY)) {
                relayNotification.setEmailhandlerbean(OpportunityRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.CASE)) {
                relayNotification.setEmailhandlerbean(CaseRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.TASK)) {
                relayNotification.setEmailhandlerbean(TaskRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.MEETING)) {
                relayNotification.setEmailhandlerbean(MeetingRelayEmailNotificationAction.class.getName());
            } else if (type.equals(CrmTypeConstants.CALL)) {
                relayNotification.setEmailhandlerbean(CallRelayEmailNotificationAction.class.getName());
            }
            RelayEmailNotificationService relayEmailNotificationService = ApplicationContextUtil
                    .getSpringBean(RelayEmailNotificationService.class);
            relayEmailNotificationService.saveWithSession(relayNotification, AppContext.getUsername());
            noteInput.setValue("");
            displayNotes();
        }
    });
    commentBox.addComponent(postBtn);

    this.setToolbar(commentBox);

}

From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountRelatedContactView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addContact = new NavigationBarQuickMenu();
    addContact.setStyleName("add-btn");

    VerticalLayout addButtons = new VerticalLayout();
    addButtons.setSpacing(true);//from   ww w.java  2s  .  com
    addButtons.setWidth("100%");
    addButtons.setMargin(true);
    addButtons.addStyleName("edit-btn-layout");

    Button newContact = new Button(AppContext.getMessage(ContactI18nEnum.VIEW_NEW_TITLE));
    newContact.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent arg0) {
            fireNewRelatedItem("");
        }
    });
    addButtons.addComponent(newContact);

    Button selectContact = new Button(AppContext.getMessage(ContactI18nEnum.M_TITLE_SELECT_CONTACTS));
    selectContact.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 243969948418203441L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            AccountContactSelectionView contactSelectionView = new AccountContactSelectionView(
                    AccountRelatedContactView.this);
            final ContactSearchCriteria criteria = new ContactSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            contactSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(AccountRelatedContactView.this, contactSelectionView));

        }
    });
    addButtons.addComponent(selectContact);

    addContact.setContent(addButtons);

    return addContact;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountRelatedLeadView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addLead = new NavigationBarQuickMenu();
    addLead.setStyleName("add-btn");

    VerticalLayout addButtons = new VerticalLayout();
    addButtons.setSpacing(true);/* w  ww.j ava2 s .  c  om*/
    addButtons.setWidth("100%");
    addButtons.setMargin(true);
    addButtons.addStyleName("edit-btn-layout");

    Button newLead = new Button(AppContext.getMessage(LeadI18nEnum.VIEW_NEW_TITLE));
    newLead.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 8228954365650824438L;

        @Override
        public void buttonClick(Button.ClickEvent arg0) {
            fireNewRelatedItem("");
        }
    });
    addButtons.addComponent(newLead);

    Button selectLead = new Button(AppContext.getMessage(LeadI18nEnum.M_TITLE_SELECT_LEADS));
    selectLead.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 9076596614526838523L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            AccountLeadSelectionView leadSelectionView = new AccountLeadSelectionView(
                    AccountRelatedLeadView.this);
            final LeadSearchCriteria criteria = new LeadSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            leadSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(AccountRelatedLeadView.this, leadSelectionView));

        }
    });
    addButtons.addComponent(selectLead);

    addLead.setContent(addButtons);

    return addLead;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.ActivityListViewImpl.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addActivity = new NavigationBarQuickMenu();
    addActivity.setStyleName("add-btn");

    addButtons = new VerticalLayout();
    addButtons.setSpacing(true);/*from   w ww .j a v  a2  s  .  c  om*/
    addButtons.setWidth("100%");
    addButtons.setMargin(true);
    addButtons.addStyleName("edit-btn-layout");

    Button addTask = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASK));
    addTask.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1920289198458066344L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new ActivityEvent.TaskAdd(this, null));
        }
    });
    addButtons.addComponent(addTask);

    Button addCall = new Button(AppContext.getMessage(CallI18nEnum.BUTTON_NEW_CALL));
    addCall.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -279151189261011902L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new ActivityEvent.CallAdd(this, null));
        }
    });
    addButtons.addComponent(addCall);

    Button addMeeting = new Button(AppContext.getMessage(MeetingI18nEnum.BUTTON_NEW_MEETING));
    addMeeting.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 4770664404728700960L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new ActivityEvent.MeetingAdd(this, null));
        }
    });
    addButtons.addComponent(addMeeting);

    addActivity.setContent(addButtons);

    return addActivity;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.ActivityRelatedItemView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addActivity = new NavigationBarQuickMenu();
    addActivity.setStyleName("add-btn");

    addButtons = new VerticalLayout();
    addButtons.setSpacing(true);/*w  w  w  . j  a v a  2 s.co m*/
    addButtons.setWidth("100%");
    addButtons.setMargin(true);
    addButtons.addStyleName("edit-btn-layout");

    Button addTask = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASK));
    addTask.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1920289198458066344L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            fireNewRelatedItem(CrmTypeConstants.TASK);
        }
    });
    addButtons.addComponent(addTask);

    Button addCall = new Button(AppContext.getMessage(CallI18nEnum.BUTTON_NEW_CALL));
    addCall.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -279151189261011902L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            fireNewRelatedItem(CrmTypeConstants.CALL);
        }
    });
    addButtons.addComponent(addCall);

    Button addMeeting = new Button(AppContext.getMessage(MeetingI18nEnum.BUTTON_NEW_MEETING));
    addMeeting.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 4770664404728700960L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            fireNewRelatedItem(CrmTypeConstants.MEETING);
        }
    });
    addButtons.addComponent(addMeeting);

    addActivity.setContent(addButtons);

    return addActivity;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.campaign.CampaignRelatedAccountView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addAccount = new NavigationBarQuickMenu();
    addAccount.setStyleName("add-btn");

    VerticalLayout addButtons = new VerticalLayout();
    addButtons.setSpacing(true);//from   www  .  j a  va  2  s .c  o m
    addButtons.setWidth("100%");
    addButtons.setMargin(true);
    addButtons.addStyleName("edit-btn-layout");

    Button newAccount = new Button(AppContext.getMessage(AccountI18nEnum.VIEW_NEW_TITLE));
    newAccount.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent arg0) {
            fireNewRelatedItem("");
        }
    });
    addButtons.addComponent(newAccount);

    Button selectAccount = new Button(AppContext.getMessage(AccountI18nEnum.M_TITLE_SELECT_ACCOUNTS));
    selectAccount.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 270503987054356318L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            CampaignAccountSelectionView accountSelectionView = new CampaignAccountSelectionView(
                    CampaignRelatedAccountView.this);
            AccountSearchCriteria criteria = new AccountSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            accountSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(CampaignRelatedAccountView.this, accountSelectionView));
        }
    });
    addButtons.addComponent(selectAccount);

    addAccount.setContent(addButtons);

    return addAccount;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.campaign.CampaignRelatedContactView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addContact = new NavigationBarQuickMenu();
    addContact.setStyleName("add-btn");

    VerticalLayout addButtons = new VerticalLayout();
    addButtons.setWidth("100%");
    addButtons.setSpacing(true);//from  w  w w  . j ava 2 s .c  om
    addButtons.setMargin(true);
    addButtons.setStyleName("edit-btn-layout");

    Button newContact = new Button(AppContext.getMessage(ContactI18nEnum.VIEW_NEW_TITLE));
    newContact.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent arg0) {
            fireNewRelatedItem("");
        }
    });
    addButtons.addComponent(newContact);

    Button selectContact = new Button(AppContext.getMessage(ContactI18nEnum.M_TITLE_SELECT_CONTACTS));
    selectContact.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -429296782998301810L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            CampaignContactSelectionView contactSelectionView = new CampaignContactSelectionView(
                    CampaignRelatedContactView.this);
            ContactSearchCriteria criteria = new ContactSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            contactSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(CampaignRelatedContactView.this, contactSelectionView));
        }
    });
    addButtons.addComponent(selectContact);

    addContact.setContent(addButtons);

    return addContact;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.campaign.CampaignRelatedLeadView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addLead = new NavigationBarQuickMenu();
    addLead.setStyleName("add-btn");

    VerticalLayout addBtns = new VerticalLayout();
    addBtns.setWidth("100%");
    addBtns.setSpacing(true);/*from   ww  w . j av a 2 s .c  o  m*/
    addBtns.setMargin(true);
    addBtns.setStyleName("edit-btn-layout");

    Button newLead = new Button(AppContext.getMessage(LeadI18nEnum.VIEW_NEW_TITLE));
    newLead.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent arg0) {
            fireNewRelatedItem("");
        }
    });
    addBtns.addComponent(newLead);

    Button selectLead = new Button(AppContext.getMessage(LeadI18nEnum.M_TITLE_SELECT_LEADS));
    selectLead.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -8749458276290086097L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            CampaignLeadSelectionView leadSelectionView = new CampaignLeadSelectionView(
                    CampaignRelatedLeadView.this);
            LeadSearchCriteria criteria = new LeadSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            leadSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(CampaignRelatedLeadView.this, leadSelectionView));
        }
    });
    addBtns.addComponent(selectLead);

    addLead.setContent(addBtns);

    return addLead;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.cases.CaseRelatedContactView.java

License:Open Source License

@Override
protected Component createRightComponent() {
    final NavigationBarQuickMenu addContact = new NavigationBarQuickMenu();
    addContact.setStyleName("add-btn");

    VerticalLayout addBtns = new VerticalLayout();
    addBtns.setWidth("100%");
    addBtns.setSpacing(true);//  w w  w .  jav  a 2s  . c o  m
    addBtns.setMargin(true);
    addBtns.setStyleName("edit-btn-layout");

    Button newContact = new Button(AppContext.getMessage(ContactI18nEnum.VIEW_NEW_TITLE));
    newContact.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent arg0) {
            fireNewRelatedItem("");
        }
    });
    addBtns.addComponent(newContact);

    Button selectContact = new Button(AppContext.getMessage(ContactI18nEnum.M_TITLE_SELECT_CONTACTS));
    selectContact.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 5491307760254926146L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            CaseContactSelectionView contactSelectionView = new CaseContactSelectionView(
                    CaseRelatedContactView.this);
            ContactSearchCriteria criteria = new ContactSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            contactSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(CaseRelatedContactView.this, contactSelectionView));
        }
    });
    addBtns.addComponent(selectContact);

    addContact.setContent(addBtns);

    return addContact;
}