Example usage for com.vaadin.ui VerticalLayout setComponentAlignment

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

Introduction

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

Prototype

@Override
    public void setComponentAlignment(Component childComponent, Alignment alignment) 

Source Link

Usage

From source file:com.compomics.sigpep.webapp.MyVaadinApplication.java

License:Apache License

@Override
public void init() {
    iApplication = this;
    iSigPepSessionFactory = ApplicationLocator.getInstance().getApplication().getSigPepSessionFactory();

    //add theme//from www .j  a  va2 s  .co  m
    setTheme("sigpep");

    //add main window
    Window lMainwindow = new Window("Sigpep Application");
    setMainWindow(lMainwindow);
    lMainwindow.addStyleName("v-app-my");

    //add notification component
    iNotifique = new Notifique(Boolean.FALSE);
    CustomOverlay lCustomOverlay = new CustomOverlay(iNotifique, getMainWindow());
    getMainWindow().addComponent(lCustomOverlay);

    //add form help
    iFormHelp = new FormHelp();
    iFormHelp.setFollowFocus(Boolean.TRUE);
    this.getMainWindow().getContent().addComponent(iFormHelp);

    //add panels
    iCenterLeft = new Panel();
    iCenterLeft.addStyleName(Reindeer.PANEL_LIGHT);
    iCenterLeft.setHeight("400px");
    iCenterLeft.setWidth("100%");

    iCenterRight = new Panel();
    iCenterRight.addStyleName(Reindeer.PANEL_LIGHT);
    iCenterRight.setHeight("400px");
    iCenterRight.setWidth("75%");

    //add form tabs
    iFormTabSheet = new FormTabSheet(this);
    iCenterLeft.addComponent(iFormTabSheet);

    iBottomLayoutResults = new VerticalLayout();

    if (PropertiesConfigurationHolder.showTestDemoFolder()) {
        Button lButton = new Button("load test data");
        lButton.addListener(new Button.ClickListener() {
            public void buttonClick(Button.ClickEvent event) {
                new BackgroundThread().run();
            }
        });
        iBottomLayoutResults.addComponent(lButton);
    }

    // Add the selector component
    iSelectionComponent = new TransitionSelectionComponent(MyVaadinApplication.this);
    iCenterRight.addComponent(iSelectionComponent);

    iHeaderLayout = new HorizontalLayout();
    iHeaderLayout.setSizeFull();
    iHeaderLayout.setHeight("100px");
    iHeaderLayout.addStyleName("v-header");

    VerticalLayout lVerticalLayout = new VerticalLayout();

    GridLayout lGridLayout = new GridLayout(2, 1);
    lGridLayout.setSpacing(true);
    lGridLayout.setSizeFull();

    lGridLayout.addComponent(iCenterLeft, 0, 0);
    lGridLayout.setComponentAlignment(iCenterLeft, Alignment.TOP_LEFT);

    lGridLayout.addComponent(iCenterRight, 1, 0);
    lGridLayout.setComponentAlignment(iCenterRight, Alignment.TOP_CENTER);

    lVerticalLayout.addComponent(iHeaderLayout);
    lVerticalLayout.addComponent(lGridLayout);
    lVerticalLayout.addComponent(iBottomLayoutResults);

    lVerticalLayout.setComponentAlignment(iHeaderLayout, Alignment.MIDDLE_CENTER);
    lVerticalLayout.setComponentAlignment(lGridLayout, Alignment.MIDDLE_CENTER);
    lVerticalLayout.setComponentAlignment(iBottomLayoutResults, Alignment.MIDDLE_CENTER);

    lMainwindow.addComponent(lVerticalLayout);
    lMainwindow.addComponent(pusher);

    // Create a tracker for vaadin.com domain.
    String lDomainName = PropertiesConfigurationHolder.getInstance().getString("analytics.domain");
    String lPageId = PropertiesConfigurationHolder.getInstance().getString("analytics.page");

    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker("UA-26252212-1", lDomainName);
    lMainwindow.addComponent(tracker);
    tracker.trackPageview(lPageId);

    /**
     * Sets an UncaughtExceptionHandler and executes the thread by the ExecutorsService
     */
    Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler());

    parseSessionId();
}

From source file:com.dungnv.streetfood.view.CategoryLink.java

private void init() {

    setLocale(VaadinSession.getCurrent().getLocale());
    tabSheet = new TabSheet();
    tabSheet.setStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    tabSheet.setSizeFull();/*  w w w .  jav a 2s  . c o m*/

    VerticalLayout vLayout = new VerticalLayout();

    tuiDish = new TwinColumnUI("name");
    tuiDish.setLeftLabelCaption(BundleUtils.getLanguage("lbl.dish.avaiable.list"));
    tuiDish.setRightLabelCaption(BundleUtils.getLanguage("lbl.dish.selected.list"));
    vLayout.addComponent(tuiDish);

    lsDishLeft = tuiDish.getMsLeft().getLsItem();
    lsDishRight = tuiDish.getMsRight().getLsItem();
    HorizontalLayout hlButtonFooter = new HorizontalLayout();
    hlButtonFooter.setSpacing(true);
    hlButtonFooter.setMargin(true);
    vLayout.addComponent(hlButtonFooter);
    vLayout.setComponentAlignment(hlButtonFooter, Alignment.BOTTOM_RIGHT);

    btnCancel = new Button(BundleUtils.getLanguage("lbl.cancel"), FontAwesome.BAN);
    hlButtonFooter.addComponent(btnCancel);

    tabSheet.addTab(vLayout, BundleUtils.getLanguage("lbl.category.categoryDish.tab"));
    setContent(tabSheet);
}

From source file:com.esofthead.mycollab.community.view.NotPresentedView.java

License:Open Source License

public NotPresentedView() {
    this.setHeight("370px");
    this.setWidth("100%");
    VerticalLayout layoutWapper = new VerticalLayout();
    layoutWapper.setWidth("100%");

    VerticalLayout layout = new VerticalLayout();
    final Embedded titleIcon = new Embedded();
    titleIcon.setSource(MyCollabResource.newResource("icons/not_present.png"));
    layout.addComponent(titleIcon);//from   w ww. java  2  s .c o  m
    layout.setComponentAlignment(titleIcon, Alignment.MIDDLE_CENTER);

    Label label = new Label("Module is not presented for community edition");
    label.setStyleName("h2_community");
    layout.addComponent(label);
    layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    layoutWapper.addComponent(layout);
    layoutWapper.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);
    this.addComponent(layoutWapper);
    this.setComponentAlignment(layoutWapper, Alignment.MIDDLE_CENTER);
}

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);//from  www.  jav a2 s.co  m
    Label header = new Label(AppContext.getMessage(BugI18nEnum.M_FORM_READ_TITLE));
    header.setStyleName("h2");
    layout.addComponent(header);

    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;
}

From source file:com.esofthead.mycollab.mobile.module.project.view.milestone.MilestoneFormLayoutFactory.java

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(false);//  w  w  w.  ja  v  a  2 s  . co m
    Label header = new Label(AppContext.getMessage(MilestoneI18nEnum.M_FORM_READ_TITLE));
    header.setStyleName("h2");
    layout.addComponent(header);

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

From source file:com.esofthead.mycollab.mobile.module.project.view.settings.ProjectMemberFormLayoutFactory.java

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(false);/*from   w w  w.  ja v  a2  s  .c  o m*/
    Label header = new Label(AppContext.getMessage(ProjectMemberI18nEnum.FORM_INFORMATION_SECTION));
    header.setStyleName("h2");
    layout.addComponent(header);

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

From source file:com.esofthead.mycollab.mobile.module.project.view.task.TaskFormLayoutFactory.java

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(false);// ww w  .  j a v  a2s.com
    Label header = new Label(AppContext.getMessage(TaskI18nEnum.M_FORM_READ_TITLE));
    header.setStyleName("h2");
    layout.addComponent(header);

    this.informationLayout = new GridFormLayoutHelper(1, 11, "100%", "150px", Alignment.TOP_LEFT);

    this.informationLayout.getLayout().setMargin(false);
    this.informationLayout.getLayout().setWidth("100%");
    this.informationLayout.getLayout().addStyleName("colored-gridlayout");
    layout.addComponent(this.informationLayout.getLayout());
    layout.setComponentAlignment(this.informationLayout.getLayout(), Alignment.BOTTOM_CENTER);
    return layout;
}

From source file:com.esofthead.mycollab.mobile.module.project.view.task.TaskGroupFormLayoutFactory.java

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    Label header = new Label(AppContext.getMessage(TaskGroupI18nEnum.M_FORM_READ_TITLE));
    header.setStyleName("h2");
    layout.addComponent(header);//from  ww  w  .ja va 2  s  .c  o m
    this.informationLayout = new GridFormLayoutHelper(1, 6, "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;
}

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

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");
    final SplitButton controlsBtn = new SplitButton();
    controlsBtn.setSizeUndefined();/*w w w. j  av  a2 s.  c om*/
    controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CONTACT));
    controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    controlsBtn.setCaption(AppContext.getMessage(ContactI18nEnum.BUTTON_NEW_CONTACT));
    controlsBtn.setIcon(FontAwesome.PLUS);
    controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void splitButtonClick(final SplitButton.SplitButtonClickEvent event) {
            fireNewRelatedItem("");
        }
    });
    final Button selectBtn = new Button("Select from existing contacts", new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            final AccountContactSelectionWindow contactsWindow = new AccountContactSelectionWindow(
                    AccountContactListComp.this);
            final ContactSearchCriteria criteria = new ContactSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            UI.getCurrent().addWindow(contactsWindow);
            contactsWindow.setSearchCriteria(criteria);
            controlsBtn.setPopupVisible(false);
        }
    });
    selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select));
    selectBtn.setStyleName("link");
    VerticalLayout buttonControlLayout = new VerticalLayout();
    buttonControlLayout.addComponent(selectBtn);
    controlsBtn.setContent(buttonControlLayout);

    controlsBtnWrap.addComponent(controlsBtn);
    controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    return controlsBtnWrap;
}

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

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");
    final SplitButton controlsBtn = new SplitButton();
    controlsBtn.setSizeUndefined();//  w  w  w  .ja v  a2s.c om
    controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_LEAD));
    controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    controlsBtn.setCaption(AppContext.getMessage(LeadI18nEnum.BUTTON_NEW_LEAD));
    controlsBtn.setIcon(FontAwesome.PLUS);
    controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void splitButtonClick(final SplitButton.SplitButtonClickEvent event) {
            fireNewRelatedItem("");
        }
    });
    final Button selectBtn = new Button("Select from existing leads", new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            final AccountLeadSelectionWindow leadsWindow = new AccountLeadSelectionWindow(
                    AccountLeadListComp.this);
            final LeadSearchCriteria criteria = new LeadSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId()));
            UI.getCurrent().addWindow(leadsWindow);
            leadsWindow.setSearchCriteria(criteria);
            controlsBtn.setPopupVisible(false);
        }
    });
    selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select));
    selectBtn.setStyleName("link");
    VerticalLayout buttonControlLayout = new VerticalLayout();
    buttonControlLayout.addComponent(selectBtn);
    controlsBtn.setContent(buttonControlLayout);

    controlsBtnWrap.addComponent(controlsBtn);
    controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    return controlsBtnWrap;
}