Example usage for com.vaadin.ui VerticalLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:annis.gui.EmbeddedVisUI.java

License:Apache License

private void displayLoadingIndicator() {
    VerticalLayout layout = new VerticalLayout();

    layout.addStyleName("v-app-loading");
    layout.setSizeFull();/*from ww w .  j  a  va2 s . c om*/

    setContent(layout);
}

From source file:at.peppol.webgui.app.MainWindow.java

License:Mozilla Public License

public void showInitialMainContent(UserFolder<?> userFolder) {
    // ------ START: Main Content -------
    final VerticalLayout mainContentLayout = new VerticalLayout();

    mainContentLayout.addStyleName("margin");
    final VerticalLayout topmain = new VerticalLayout();
    topmain.setSpacing(true);//from   www. ja  v a2s  .  c o  m
    topmain.setWidth("100%");
    final Label bigPAWGLabel = new Label("PEPPOL Post Award Web GUI");
    bigPAWGLabel.setStyleName("huge");
    topmain.addComponent(bigPAWGLabel);
    final Label blahContent = new Label(
            "This is a mockup of the GUI that is going" + " to be the PAWG. It is created by the Greek"
                    + " and Austrian teams as a fine replacement " + " of the Demo Client");
    blahContent.setWidth("80%");
    blahContent.addStyleName("big");
    //topmain.addComponent (blahContent);
    //HorizontalLayout itemsPanel = new ShowItemsPanel("Items", um, userFolder);

    final ShowItemsPanel itemsPanel = new ShowItemsPanel("Items", um, userFolder);
    this.itemsPanel = itemsPanel;
    topmain.addComponent(itemsPanel);
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setSpacing(true);
    topmain.addComponent(buttonsLayout);
    Button loadButton = new Button("Load invoice");
    //topmain.addComponent(loadButton);
    buttonsLayout.addComponent(loadButton);
    loadButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            Table table = itemsPanel.getTable();
            if (table.getValue() != null) {
                //InvoiceType inv = (InvoiceType)table.getItem(table.getValue()).getItemProperty("invoice").getValue();
                //InvoiceBean invBean = (InvoiceBean)table.getItem(table.getValue());
                InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource())
                        .getItem(table.getValue()).getBean();
                //System.out.println("Invoice is: "+invBean);
                showInvoiceForm(invBean);
            }
        }
    });

    Button sendButton = new Button("Send invoice");
    buttonsLayout.addComponent(sendButton);
    sendButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                Table table = itemsPanel.getTable();
                if (table.getValue() != null) {
                    InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource())
                            .getItem(table.getValue()).getBean();
                    String path = invBean.getFolderEntryID();
                    FileSystemResource s = new FileSystemResource(path);
                    SendInvoice.sendDocument(s);

                    //file is sent. move invoice to outbox
                    um.moveInvoice(invBean, um.getDrafts(), um.getOutbox());
                    //itemsPanel.getTable().requestRepaint();
                    itemsPanel.init(um.getDrafts());
                }
            } catch (FileNotFoundException e) {
                getWindow().showNotification("Could not find invoice file", Notification.TYPE_ERROR_MESSAGE);
            } catch (Exception e) {
                getWindow().showNotification("Could not send invoice. AP connection error",
                        Notification.TYPE_ERROR_MESSAGE);
                e.printStackTrace();
            }
        }
    });

    final Button learnMoreBtn = new Button("Learn More >>");
    learnMoreBtn.addStyleName("tall default");
    //topmain.addComponent (learnMoreBtn);

    mainContentLayout.addComponent(topmain);
    // ------ END: Main Content ---------
    mainContentLayout.setHeight("100%");
    mainContentLayout.setSizeFull();

    mainContentLayout.setSpacing(true);
    mainContentLayout.setWidth("100%");
    middleContentLayout.setWidth("100%");
    middleContentLayout.setHeight("100%");
    middleContentLayout.setMargin(true);
    // --------
    addComponent(middleContentLayout);
    addComponent(footerLayout);
    if (mainContentComponent != null) {
        middleContentLayout.replaceComponent(mainContentComponent, mainContentLayout);
    } else {
        middleContentLayout.addComponent(mainContentLayout);
    }
    middleContentLayout.setExpandRatio(mainContentLayout, 1);
    mainContentComponent = mainContentLayout;
}

From source file:by.bigvova.ui.LoginUI.java

License:Apache License

private Component buildLoginForm() {
    final VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSizeUndefined();/*w ww  .  j  a va 2 s . com*/
    loginPanel.setSpacing(true);
    Responsive.makeResponsive(loginPanel);
    loginPanel.addStyleName("login-panel");

    loginPanel.addComponent(buildLabels());
    loginPanel.addComponent(buildFields());
    return loginPanel;
}

From source file:com.digitallabs.demos.Vaadin6BootstrapThemeDemo.java

License:Apache License

private void forms(ComponentContainer container) {
    VerticalLayout form = new VerticalLayout();
    form.addStyleName(Bootstrap.Forms.FORM.styleName());
    form.setSpacing(true);// w  ww .ja  v a 2s. co  m
    form.setCaption("Legend");

    TextField email = new TextField("Email address");
    email.setInputPrompt("Enter email");
    form.addComponent(email);

    PasswordField password = new PasswordField("Password");
    password.setInputPrompt("Password");
    form.addComponent(password);

    Upload upload = new Upload("File input", null);
    form.addComponent(upload);

    Label help = new Label("Example block-level help text here.");
    help.addStyleName("help-block");
    form.addComponent(help);

    CheckBox check = new CheckBox("Check me out");
    form.addComponent(check);

    Button submit = new Button("Submit");
    submit.addStyleName(Bootstrap.Buttons.DEFAULT.styleName());
    form.addComponent(submit);

    container.addComponent(form);
}

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.jav a2  s .  c  o m
    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);/*from w w  w. j  av  a 2s  .  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.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);/* w  w  w . ja  v  a2  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.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 w w . ja va2s. com*/
    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);
}