Example usage for com.vaadin.ui VerticalLayout setMargin

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

Introduction

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

Prototype

@Override
    public void setMargin(boolean enabled) 

Source Link

Usage

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 ww . ja v  a 2 s  .  co 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;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.contact.ContactRelatedOpportunityView.java

License:Open Source License

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

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

    Button newOpportunity = new Button(AppContext.getMessage(OpportunityI18nEnum.VIEW_NEW_TITLE));
    newOpportunity.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7172838996944732255L;

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

    Button selectOpportunity = new Button(
            AppContext.getMessage(OpportunityI18nEnum.M_TITLE_SELECT_OPPORTUNITIES));
    selectOpportunity.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -8732749124902402042L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            ContactOpportunitySelectionView opportunitySelectionView = new ContactOpportunitySelectionView(
                    ContactRelatedOpportunityView.this);
            OpportunitySearchCriteria criteria = new OpportunitySearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            opportunitySelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance().post(
                    new ShellEvent.PushView(ContactRelatedOpportunityView.this, opportunitySelectionView));
        }
    });
    addBtns.addComponent(selectOpportunity);

    addOpportunity.setContent(addBtns);

    return addOpportunity;
}

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

License:Open Source License

private void initUI() {
    this.setStyleName("login-view");
    this.setSizeFull();

    VerticalLayout contentLayout = new VerticalLayout();
    contentLayout.setStyleName("content-wrapper");
    contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    contentLayout.setMargin(true);
    contentLayout.setSpacing(true);//from  w w  w  .j  ava  2s.c o m
    contentLayout.setWidth("320px");

    Image mainLogo = new Image(null, new ThemeResource("icons/logo_m.png"));
    contentLayout.addComponent(mainLogo);

    Label introText = new Label(
            "MyCollab helps you do all your office jobs on the computers, phones and tablets you use");
    introText.setStyleName("intro-text");
    contentLayout.addComponent(introText);

    CssLayout welcomeTextWrapper = new CssLayout();
    welcomeTextWrapper.setStyleName("welcometext-wrapper");
    welcomeTextWrapper.setWidth("100%");
    Label welcomeText = new Label("Login to CRM");
    welcomeText.setWidth("150px");
    welcomeTextWrapper.addComponent(welcomeText);
    contentLayout.addComponent(welcomeTextWrapper);

    final EmailField emailField = new EmailField();
    emailField.setWidth("100%");
    emailField.setInputPrompt("E-mail Address");
    emailField.setStyleName("email-input");
    contentLayout.addComponent(emailField);

    final PasswordField pwdField = new PasswordField();
    pwdField.setWidth("100%");
    pwdField.setInputPrompt("Password");
    pwdField.setStyleName("password-input");
    contentLayout.addComponent(pwdField);

    final CheckBox rememberPassword = new CheckBox();
    rememberPassword.setWidth("100%");
    rememberPassword.setCaption("Remember password");
    rememberPassword.setValue(true);
    contentLayout.addComponent(rememberPassword);

    Button signInBtn = new Button("Sign In");
    signInBtn.setWidth("100%");
    signInBtn.addStyleName(UIConstants.BUTTON_BIG);
    signInBtn.addStyleName(UIConstants.COLOR_BLUE);
    signInBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new CrmEvent.PlainLogin(this, new String[] {
                    emailField.getValue(), pwdField.getValue(), String.valueOf(rememberPassword.getValue()) }));
        }
    });
    contentLayout.addComponent(signInBtn);

    Button createAccountBtn = new Button("Create Account");
    createAccountBtn.setWidth("100%");
    createAccountBtn.addStyleName(UIConstants.BUTTON_BIG);
    createAccountBtn.addStyleName(UIConstants.COLOR_GRAY);
    contentLayout.addComponent(createAccountBtn);

    this.addComponent(contentLayout);
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.lead.LeadRelatedCampaignView.java

License:Open Source License

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

    VerticalLayout addBtns = new VerticalLayout();
    addBtns.setStyleName("edit-btn-layout");
    addBtns.setSpacing(true);/*  w ww.j a  va2  s  .com*/
    addBtns.setMargin(true);
    addBtns.setWidth("100%");

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

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

    Button selectCampaign = new Button(AppContext.getMessage(CampaignI18nEnum.M_TITLE_SELECT_CAMPAIGNS));
    selectCampaign.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 6803421194441320713L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            final LeadCampaignSelectionView campaignSelectionView = new LeadCampaignSelectionView(
                    LeadRelatedCampaignView.this);
            CampaignSearchCriteria criteria = new CampaignSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            campaignSelectionView.setSearchCriteria(criteria);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.PushView(LeadRelatedCampaignView.this, campaignSelectionView));
        }
    });
    addBtns.addComponent(selectCampaign);

    addCampaign.setContent(addBtns);

    return addCampaign;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.opportunity.OpportunityRelatedContactView.java

License:Open Source License

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

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

    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 = 200350509131199170L;

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

    addContact.setContent(addBtns);

    return addContact;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.opportunity.OpportunityRelatedLeadView.java

License:Open Source License

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

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

    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 = -1004824769733665112L;

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

    addLead.setContent(addBtns);

    return addLead;
}

From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java

License:Open Source License

private void initUI() {
    headerPanel = new HorizontalLayout();
    headerPanel.setWidth("100%");
    headerPanel.setStyleName("summary-info-panel");
    headerPanel.setMargin(new MarginInfo(true, false, true, false));
    headerPanel.setHeightUndefined();//from  w ww . j  a v a  2 s . c  o  m
    content.addComponent(headerPanel);
    constructSpentTimeEntryPanel();
    constructRemainTimeEntryPanel();

    this.tableItem = new DefaultPagedBeanList<ItemTimeLoggingService, ItemTimeLoggingSearchCriteria, SimpleItemTimeLogging>(
            ApplicationContextUtil.getSpringBean(ItemTimeLoggingService.class), new TimeLogRowHandler()) {

        private static final long serialVersionUID = -4549910960891655297L;

        @Override
        protected void renderRows() {
            int i = 0;
            Date currentDate = new GregorianCalendar(2100, 1, 1).getTime();
            for (final SimpleItemTimeLogging item : currentListData) {
                if (!DateUtils.isSameDay(item.getLogforday(), currentDate)) {
                    Label dateLbl = new Label(AppContext.formatDate(item.getLogforday()));
                    dateLbl.setStyleName("log-day");
                    listContainer.addComponent(dateLbl);
                    currentDate = item.getLogforday();
                }
                final Component row = getRowDisplayHandler().generateRow(item, i);
                listContainer.addComponent(row);
                i++;
            }
        }

    };

    this.tableItem.setWidth("100%");
    content.addComponent(tableItem);
    content.setExpandRatio(tableItem, 1.0f);

    VerticalLayout controlBtns = new VerticalLayout();
    controlBtns.setSpacing(true);
    controlBtns.setWidth("100%");
    controlBtns.setMargin(true);
    controlBtns.addStyleName("edit-btn-layout");
    controlBtns.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);

    Button addNewEntryBtn = new Button(AppContext.getMessage(TimeTrackingI18nEnum.M_DIALOG_ADD_TIME_LOG_ENTRY),
            new Button.ClickListener() {

                private static final long serialVersionUID = -2540265040691537699L;

                @Override
                public void buttonClick(Button.ClickEvent event) {
                    UI.getCurrent().addWindow(new NewTimeLogEntryWindow());
                }
            });
    addNewEntryBtn.setWidth("100%");
    controlBtns.addComponent(addNewEntryBtn);

    Button updateRemainTimeBtn = new Button(
            AppContext.getMessage(TimeTrackingI18nEnum.M_DIALOG_UPDATE_REMAIN_HOURS),
            new Button.ClickListener() {

                private static final long serialVersionUID = 9215577509351959739L;

                @Override
                public void buttonClick(Button.ClickEvent event) {
                    UI.getCurrent().addWindow(new UpdateRemainTimeWindow());
                }
            });
    updateRemainTimeBtn.setWidth("100%");
    controlBtns.addComponent(updateRemainTimeBtn);

    NavigationBarQuickMenu editBtn = new NavigationBarQuickMenu();
    editBtn.setButtonCaption(null);
    editBtn.setStyleName("edit-btn");
    editBtn.setContent(controlBtns);
    this.setRightComponent(editBtn);
}

From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java

License:Open Source License

private void constructSpentTimeEntryPanel() {
    final VerticalLayout totalLayout = new VerticalLayout();
    totalLayout.setMargin(new MarginInfo(false, true, false, true));
    totalLayout.setStyleName("summary-block");
    totalLayout.addStyleName("total-time");
    totalLayout.setWidth("100%");
    final Label lbTimeInstructTotal = new Label(
            AppContext.getMessage(TimeTrackingI18nEnum.OPT_TOTAL_SPENT_HOURS));
    lbTimeInstructTotal.setStyleName("block-label");
    totalLayout.addComponent(lbTimeInstructTotal);
    this.totalSpentTimeLbl = new Label("_");
    this.totalSpentTimeLbl.setStyleName("block-value");
    this.totalSpentTimeLbl.addStyleName("numberTotal");
    totalLayout.addComponent(this.totalSpentTimeLbl);

    headerPanel.addComponent(totalLayout);
}

From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java

License:Open Source License

private void constructRemainTimeEntryPanel() {
    final VerticalLayout updateLayout = new VerticalLayout();
    updateLayout.setMargin(new MarginInfo(false, true, false, true));
    updateLayout.setStyleName("summary-block");
    updateLayout.addStyleName("remain-time");
    updateLayout.setWidth("100%");

    final Label lbTimeInstructTotal = new Label(
            AppContext.getMessage(TimeTrackingI18nEnum.OPT_REMAINING_WORK_HOURS));
    lbTimeInstructTotal.setStyleName("block-label");
    updateLayout.addComponent(lbTimeInstructTotal);
    this.remainTimeLbl = new Label("_");
    this.remainTimeLbl.setStyleName("block-value");
    this.remainTimeLbl.addStyleName("numberTotal");
    updateLayout.addComponent(this.remainTimeLbl);

    this.headerPanel.addComponent(updateLayout);
}

From source file:com.esofthead.mycollab.mobile.module.project.view.bug.BugFormLayoutFactory.java

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(false);
    Label header = new Label(AppContext.getMessage(BugI18nEnum.M_FORM_READ_TITLE));
    header.setStyleName("h2");
    layout.addComponent(header);/*from  w  ww  .  j a va  2s  .c  o  m*/

    this.informationLayout = new GridFormLayoutHelper(1, 12, "100%", "150px", Alignment.TOP_LEFT);
    this.informationLayout.getLayout().addStyleName("colored-gridlayout");
    this.informationLayout.getLayout().setMargin(false);
    this.informationLayout.getLayout().setWidth("100%");
    layout.addComponent(this.informationLayout.getLayout());
    layout.setComponentAlignment(this.informationLayout.getLayout(), Alignment.BOTTOM_CENTER);
    return layout;
}