Example usage for com.vaadin.ui Alignment MIDDLE_RIGHT

List of usage examples for com.vaadin.ui Alignment MIDDLE_RIGHT

Introduction

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

Prototype

Alignment MIDDLE_RIGHT

To view the source code for com.vaadin.ui Alignment MIDDLE_RIGHT.

Click Source Link

Usage

From source file:com.hybridbpm.ui.component.development.OutParametersLayout.java

License:Apache License

public void initUI() {
    removeAllComponents();/*from w ww.j  a  v  a2 s  .com*/
    btnAdd.setCaption(("Add parameter"));
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    setMargin(true);
    setSpacing(true);
    setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : connectoModel.getOutParameters()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.BOTH);
        fieldForm.setFieldModel(fieldModel);
        addComponent(fieldForm);
    }
    addComponent(btnAdd);
    setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}

From source file:com.invient.vaadin.InvientChartsDemoWin.java

License:Apache License

private void registerSVGAndPrintEvent(final InvientCharts chart) {
    GridLayout gridLayout = new GridLayout(2, 1);
    gridLayout.setWidth("100%");
    gridLayout.setSpacing(true);//from   ww  w .  j av  a2  s . c  om
    Button svgBtn;
    gridLayout.addComponent(svgBtn = new Button("Get SVG"));
    gridLayout.setComponentAlignment(svgBtn, Alignment.MIDDLE_RIGHT);
    Button printBtn;
    gridLayout.addComponent(printBtn = new Button("Print"));
    gridLayout.setComponentAlignment(printBtn, Alignment.MIDDLE_LEFT);
    rightLayout.addComponent(gridLayout);
    svgBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            chart.addListener(new InvientCharts.ChartSVGAvailableListener() {

                @Override
                public void svgAvailable(ChartSVGAvailableEvent chartSVGAvailableEvent) {
                    logEventInfo("[svgAvailable]" + " svg -> " + chartSVGAvailableEvent.getSVG());
                }
            });
        }
    });
    printBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            chart.print();
        }
    });
}

From source file:com.jain.common.header.Header.java

License:Apache License

private void addLogo() {
    Embedded em = new Embedded("", new ThemeResource(IMAGES_LOGO_PNG));
    addComponent(em);/*from   w w  w.  j a va 2s .com*/
    setComponentAlignment(em, Alignment.MIDDLE_RIGHT);
    setExpandRatio(em, 1);
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/**
 * ?(???)//from w  w  w  .  jav  a 2s  .co m
 */
private void createBottomComponents() {
    HorizontalLayout bottomHLayout = new HorizontalLayout();
    bottomHLayout.setSpacing(true);
    bottomHLayout.setWidth("100%");
    this.addComponent(bottomHLayout);

    // 
    HorizontalLayout bottomLeft = new HorizontalLayout();
    bottomLeft.setSpacing(true);
    bottomLeft.setWidth("-1px");
    bottomHLayout.addComponent(bottomLeft);
    bottomHLayout.setComponentAlignment(bottomLeft, Alignment.MIDDLE_LEFT);

    // ?
    save = new Button("? ", this);
    save.setStyleName("default");
    bottomLeft.addComponent(save);
    bottomLeft.setComponentAlignment(save, Alignment.MIDDLE_LEFT);

    // ?
    cancel = new Button("? ", this);
    bottomLeft.addComponent(cancel);
    bottomLeft.setComponentAlignment(cancel, Alignment.MIDDLE_LEFT);

    // ?
    HorizontalLayout bottomRight = new HorizontalLayout();
    bottomRight.setSpacing(true);
    bottomRight.setWidth("-1px");
    bottomHLayout.addComponent(bottomRight);
    bottomHLayout.setComponentAlignment(bottomRight, Alignment.MIDDLE_RIGHT);

    Label priorityCaption = new Label("<B>?</B>", Label.CONTENT_XHTML);
    priorityCaption.setWidth("-1px");
    bottomRight.addComponent(priorityCaption);
    bottomRight.setComponentAlignment(priorityCaption, Alignment.MIDDLE_RIGHT);

    priorityField = new TextField();
    priorityField.addListener(this);
    priorityField.setWidth("100px");
    priorityField.setImmediate(true);
    priorityField.setWriteThrough(false);
    bottomRight.addComponent(priorityField);
    bottomRight.setComponentAlignment(priorityField, Alignment.MIDDLE_RIGHT);

    // ?????
    setButtonsEnable(false);
}

From source file:com.klwork.explorer.project.MyCalendarView.java

License:Apache License

private void initLayoutContent() {
    initNavigationButtons();//from w ww .java 2  s.co m
    initHideWeekEndButton();
    initReadOnlyButton();
    initDisabledButton();
    initAddNewEventButton();

    HorizontalLayout hl = new HorizontalLayout();
    hl.setWidth("100%");
    hl.setSpacing(true);
    hl.setMargin(new MarginInfo(false, false, true, false));
    hl.addComponent(prevButton);
    hl.addComponent(captionLabel);
    hl.addComponent(monthButton);
    hl.addComponent(weekButton);
    hl.addComponent(nextButton);
    hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT);
    hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(monthButton, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(weekButton, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT);

    monthButton.setVisible(viewMode == Mode.WEEK);
    weekButton.setVisible(viewMode == Mode.DAY);

    HorizontalLayout controlPanel = new HorizontalLayout();
    controlPanel.setSpacing(true);
    controlPanel.setMargin(new MarginInfo(false, false, true, false));
    controlPanel.setWidth("100%");
    //controlPanel.addComponent(localeSelect);
    //controlPanel.addComponent(timeZoneSelect);
    controlPanel.addComponent(formatSelect);
    controlPanel.addComponent(hideWeekendsButton);
    //controlPanel.addComponent(readOnlyButton);
    //controlPanel.addComponent(disabledButton);
    controlPanel.addComponent(addNewEvent);

    /*controlPanel.setComponentAlignment(timeZoneSelect,
        Alignment.MIDDLE_LEFT);*/
    controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT);
    /*controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT);*/
    controlPanel.setComponentAlignment(hideWeekendsButton, Alignment.MIDDLE_LEFT);
    /* controlPanel.setComponentAlignment(readOnlyButton,
        Alignment.MIDDLE_LEFT);
     controlPanel.setComponentAlignment(disabledButton,
        Alignment.MIDDLE_LEFT);*/
    controlPanel.setComponentAlignment(addNewEvent, Alignment.MIDDLE_LEFT);

    GridLayout layout = (GridLayout) getContent();
    layout.addComponent(controlPanel);
    layout.addComponent(hl);
    layout.addComponent(calendarComponent);
    layout.setRowExpandRatio(layout.getRows() - 1, 1.0f);
}

From source file:com.klwork.explorer.project.ProjectSearchPanel.java

License:Apache License

protected void initSortMenu() {
    MenuBar menuBar = new MenuBar();
    menuBar.addStyleName(ExplorerLayout.STYLE_SEARCHBOX_SORTMENU);

    //TODO: Adding types of sorting manually and listener/events
    MenuItem rootItem = menuBar.addItem("Sort by", null);
    rootItem.addItem("Id", null);
    rootItem.addItem("Name", null);
    rootItem.addItem("Due date", null);
    rootItem.addItem("Creation date", null);

    layout.addComponent(menuBar);/*from w ww .j a v a2s  .  co  m*/
    layout.setComponentAlignment(menuBar, Alignment.MIDDLE_RIGHT);
}

From source file:com.klwork.explorer.ui.business.flow.act.MyTaskRelatedContentComponent.java

License:Apache License

protected void initActions() {
    // WW_TODO ?//w  w  w  .j  a  v a  2s . com
    HorizontalLayout actionsContainer = new HorizontalLayout();
    actionsContainer.setSizeFull();

    Label processTitle = new Label(relatedContentTitle);
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processTitle.setSizeFull();
    actionsContainer.addComponent(processTitle);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT);
    actionsContainer.setExpandRatio(processTitle, 1.0f);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT);
    //?
    if (!readOnly) {
        Button addRelatedContentButton = getAddButton();
        actionsContainer.addComponent(addRelatedContentButton);
    }

    addComponent(actionsContainer);
}

From source file:com.klwork.explorer.ui.business.project.TodoSharePopupWindow.java

License:Apache License

public TodoSharePopupWindow(String projectId) {
    super("0");
    this.socialUserWeiboService = ViewToolManager.getBean("socialUserWeiboService");
    this.socialSinaService = ViewToolManager.getBean("socialSinaService");
    this.socialUserAccountService = ViewToolManager.getBean("socialUserAccountService");
    this.socialMainService = ViewToolManager.getBean("socialMainService");
    this.i18nManager = ViewToolManager.getI18nManager();

    this.projectId = projectId;//id

    initTodoListImage(projectId);// ww  w . j  a v a  2  s . c  o m
    mainLayout = new VerticalLayout() {
        {
            setSizeFull();
            setSpacing(true);
            setMargin(new MarginInfo(true, true, false, true));

            addComponent(new HorizontalLayout() {// ?,?
                {
                    // setSizeFull();
                    // setSpacing(true);
                    setWidth("100%");
                    // setSpacing(true);
                    // setMargin(true);
                    /*Image image = initFaceComponet();
                    addComponent(image);
                    setExpandRatio(image, 1.2f);
                    setComponentAlignment(image, Alignment.MIDDLE_LEFT);*/
                    //
                    Label inputFontField = initInputFontField();
                    addComponent(inputFontField);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(inputFontField, Alignment.MIDDLE_RIGHT);
                    setExpandRatio(inputFontField, 0.2f);
                }
            });

            // ?

            weiboContentTA.setWidth("100%");
            weiboContentTA.setColumns(25);
            weiboContentTA.focus();
            addComponent(weiboContentTA);

            /*Label descriptionField = new Label();
            descriptionField.addStyleName("wb_text");
            descriptionField.setContentMode(ContentMode.HTML);
            descriptionField.setValue();
            addComponent(descriptionField);*/

            accountGroup = new OptionGroup("?????");
            accountGroup.setMultiSelect(true);
            accountGroup.setStyleName("horizontal");
            addComponent(accountGroup);
            SocialUserAccountQuery query = new SocialUserAccountQuery();
            query.setOwnUser(LoginHandler.getLoggedInUser().getId());

            List<SocialUserAccount> list = socialUserAccountService.findSocialUserAccountByQueryCriteria(query,
                    null);
            for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                SocialUserAccount s = (SocialUserAccount) iterator.next();
                String p = s.getId();
                Item i = accountGroup.addItem(p);
                accountGroup.setItemCaption(p, s.queryTypeName() + "_" + s.getName());
            }

            // 
            HorizontalLayout buttonLayout = new HorizontalLayout() {
                {
                    setSpacing(true);
                    setSizeFull();

                    Image image = initFaceComponet();//
                    addComponent(image);
                    setComponentAlignment(image, Alignment.TOP_LEFT);
                    // setMargin(true);
                    Button okButton = new Button("?");
                    addComponent(okButton);
                    setComponentAlignment(okButton, Alignment.TOP_RIGHT);

                    okButton.addClickListener(new ClickListener() {
                        public void buttonClick(ClickEvent event) {
                            handlerSendWeibo();
                            Notification.show("??", Notification.Type.HUMANIZED_MESSAGE);
                            close();
                        }
                    });
                    setExpandRatio(okButton, 1.0f);

                    Button cancleButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
                    addComponent(cancleButton);
                    setComponentAlignment(cancleButton, Alignment.TOP_RIGHT);

                    cancleButton.addClickListener(new ClickListener() {
                        public void buttonClick(ClickEvent event) {
                            // handleFormSubmit();
                            close();
                        }
                    });
                }
            };
            addComponent(buttonLayout);
            setExpandRatio(buttonLayout, 1f);

        }
    };
    setContent(mainLayout);
    setMainLayout(mainLayout);
    setWeiboContentTextArea(weiboContentTA);
}

From source file:com.klwork.explorer.ui.business.social.DiscussPopupWindow.java

License:Apache License

public VerticalLayout initMainLayout(final SocialUserWeibo userWeibo) {
    return new VerticalLayout() {
        {/*from   w ww.  j a  va 2s  .co m*/
            setSizeFull();
            setSpacing(true);
            setMargin(new MarginInfo(true, true, false, true));

            Label descriptionField = new Label();
            descriptionField.addStyleName("wb_text");
            descriptionField.setContentMode(ContentMode.HTML);
            descriptionField.setValue(
                    "@" + userWeibo.getUserScreenName() + ":" + mainPage.textTranslate(userWeibo.getText()));
            addComponent(descriptionField);

            addComponent(new HorizontalLayout() {// ?,?
                {
                    setWidth("100%");

                    //
                    Label inputFontField = initInputFontField();
                    addComponent(inputFontField);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(inputFontField, Alignment.MIDDLE_RIGHT);
                    setExpandRatio(inputFontField, 0.2f);
                }
            });

            // ?
            weiboContentTA = new TextArea("");
            weiboContentTA.setWidth("100%");
            weiboContentTA.setColumns(25);
            weiboContentTA.focus();
            addComponent(weiboContentTA);
            scheduleEventFieldGroup.bind(weiboContentTA, "content");

            // ?
            addComponent(new HorizontalLayout() {
                {
                    setSpacing(true);
                    // setSizeFull();
                    // setMargin(true);
                    CheckBox simuField = CommonFieldHandler.createCheckBox("");
                    simuField.addValueChangeListener(new Property.ValueChangeListener() {

                        private static final long serialVersionUID = -7104996493482558021L;

                        @Override
                        public void valueChange(ValueChangeEvent event) {
                            Object value = event.getProperty().getValue();
                        }

                    });
                    addComponent(simuField);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(simuField, Alignment.MIDDLE_LEFT);

                    Label commentLable = new Label();
                    commentLable.setContentMode(ContentMode.HTML);
                    commentLable.setValue("????");

                    addComponent(commentLable);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(commentLable, Alignment.MIDDLE_LEFT);

                    Image image = initFaceComponet();//
                    addComponent(image);
                }
            });

            // 
            HorizontalLayout buttonLayout = new HorizontalLayout() {
                {
                    setSpacing(true);
                    setSizeFull();
                    // setMargin(true);
                    Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
                    addComponent(okButton);
                    setComponentAlignment(okButton, Alignment.TOP_RIGHT);

                    okButton.addClickListener(new ClickListener() {
                        public void buttonClick(ClickEvent event) {
                            BinderHandler.commit(scheduleEventFieldGroup);
                            int ret = socialService.discussWeibo(weiboForwardSend);
                            if (ret == 1) {
                                Notification.show("??", Notification.Type.HUMANIZED_MESSAGE);
                            }
                            close();
                        }
                    });
                    setExpandRatio(okButton, 1.0f);

                    Button cancleButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
                    addComponent(cancleButton);
                    setComponentAlignment(cancleButton, Alignment.TOP_RIGHT);

                    cancleButton.addClickListener(new ClickListener() {
                        public void buttonClick(ClickEvent event) {
                            close();
                        }
                    });
                }
            };
            addComponent(buttonLayout);
            setExpandRatio(buttonLayout, 1f);

        }
    };
}

From source file:com.klwork.explorer.ui.business.social.TransmitPopupWindow.java

License:Apache License

public TransmitPopupWindow(final SocialUserWeibo userWeibo, final AbstractWeiboDisplayPage mainPage) {
    super(mainPage.getSocialType());
    this.socialUserWeiboService = ViewToolManager.getBean("socialUserWeiboService");
    this.socialService = AbstractSocialService.querySocialClass(mainPage.getSocialType());

    this.i18nManager = ViewToolManager.getI18nManager();

    weiboForwardSend.setWeibId(userWeibo.getWeiboId());
    weiboForwardSend.setUserAccountId(userWeibo.getUserAccountId());
    this.userWeibo = userWeibo;
    if (userWeibo.getRetweetedId() != null) {
        orginWeibo = socialUserWeiboService.findSocialUserWeiboById(userWeibo.getRetweetedId());
        hasOrginWeibo = true;/*w  ww .j  a va  2s. c o m*/
        weiboForwardSend.setWeibId(orginWeibo.getId());
    }

    scheduleEventFieldGroup.setBuffered(true);
    if (currentBeanItem != null) {
        scheduleEventFieldGroup.setItemDataSource(currentBeanItem);
    }

    mainLayout = new VerticalLayout() {
        {
            setSizeFull();
            setSpacing(true);
            setMargin(new MarginInfo(true, true, false, true));

            Label descriptionField = new Label();
            descriptionField.addStyleName("wb_text");
            descriptionField.setContentMode(ContentMode.HTML);
            descriptionField.setValue(
                    "@" + userWeibo.getUserScreenName() + ":" + mainPage.textTranslate(userWeibo.getText()));
            if (hasOrginWeibo) {
                descriptionField.setValue("@" + orginWeibo.getUserScreenName() + ":"
                        + mainPage.textTranslate(orginWeibo.getText()));
            }
            addComponent(descriptionField);

            addComponent(new HorizontalLayout() {// ?,?
                {
                    // setSizeFull();
                    // setSpacing(true);
                    setWidth("100%");
                    // setSpacing(true);
                    // setMargin(true);
                    /*Image image = initFaceComponet();
                    addComponent(image);
                    setExpandRatio(image, 1.2f);
                    setComponentAlignment(image, Alignment.MIDDLE_LEFT);*/
                    //
                    Label inputFontField = initInputFontField();
                    addComponent(inputFontField);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(inputFontField, Alignment.MIDDLE_RIGHT);
                    setExpandRatio(inputFontField, 0.2f);
                }
            });

            // ?

            weiboContentTA.setWidth("100%");
            weiboContentTA.setColumns(25);
            weiboContentTA.focus();
            addComponent(weiboContentTA);
            scheduleEventFieldGroup.bind(weiboContentTA, "content");
            if (hasOrginWeibo) {// 
                weiboContentTA.setValue("//@" + userWeibo.getUserScreenName() + ": " + userWeibo.getText());
            }

            // ?
            addComponent(new HorizontalLayout() {
                {
                    setSpacing(true);
                    // setSizeFull();
                    // setMargin(true);
                    CheckBox simuField = CommonFieldHandler.createCheckBox("");
                    simuField.addValueChangeListener(new Property.ValueChangeListener() {

                        private static final long serialVersionUID = -7104996493482558021L;

                        @Override
                        public void valueChange(ValueChangeEvent event) {
                            Object value = event.getProperty().getValue();
                        }

                    });
                    addComponent(simuField);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(simuField, Alignment.MIDDLE_LEFT);

                    Label commentLable = new Label();
                    commentLable.setContentMode(ContentMode.HTML);
                    commentLable.setValue("? " + "" + userWeibo.getUserScreenName());

                    addComponent(commentLable);
                    // setExpandRatio(image, 1.0f);
                    setComponentAlignment(commentLable, Alignment.MIDDLE_LEFT);

                    Image image = initFaceComponet();//
                    addComponent(image);
                }
            });

            if (hasOrginWeibo) {
                // ?
                addComponent(new HorizontalLayout() {
                    {
                        // setSizeFull();
                        setSpacing(true);
                        // setMargin(true);
                        CheckBox simuOriginalField = CommonFieldHandler.createCheckBox("");
                        simuOriginalField.addValueChangeListener(new Property.ValueChangeListener() {

                            private static final long serialVersionUID = -7104996493482558021L;

                            @Override
                            public void valueChange(ValueChangeEvent event) {
                                Object value = event.getProperty().getValue();
                            }

                        });
                        addComponent(simuOriginalField);
                        // setExpandRatio(image, 1.0f);
                        setComponentAlignment(simuOriginalField, Alignment.MIDDLE_LEFT);

                        Label commentLable = new Label();
                        commentLable.setContentMode(ContentMode.HTML);
                        commentLable
                                .setValue("? " + "" + orginWeibo.getUserScreenName());

                        addComponent(commentLable);
                        // setExpandRatio(image, 1.0f);
                        setComponentAlignment(commentLable, Alignment.MIDDLE_LEFT);
                    }
                });
            }

            // 
            HorizontalLayout buttonLayout = new HorizontalLayout() {
                {
                    setSpacing(true);
                    setSizeFull();
                    // setMargin(true);
                    Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
                    addComponent(okButton);
                    setComponentAlignment(okButton, Alignment.TOP_RIGHT);

                    okButton.addClickListener(new ClickListener() {
                        public void buttonClick(ClickEvent event) {
                            BinderHandler.commit(scheduleEventFieldGroup);
                            int ret = socialService.forwardWeibo(weiboForwardSend);
                            if (ret == 1) {
                                Notification.show("??", Notification.Type.HUMANIZED_MESSAGE);
                            }
                            close();
                        }
                    });
                    setExpandRatio(okButton, 1.0f);

                    Button cancleButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
                    addComponent(cancleButton);
                    setComponentAlignment(cancleButton, Alignment.TOP_RIGHT);

                    cancleButton.addClickListener(new ClickListener() {
                        public void buttonClick(ClickEvent event) {
                            // handleFormSubmit();
                            close();
                        }
                    });
                }
            };
            addComponent(buttonLayout);
            setExpandRatio(buttonLayout, 1f);

        }
    };
    setContent(mainLayout);
    setMainLayout(mainLayout);
    setWeiboContentTextArea(weiboContentTA);
}