Example usage for com.vaadin.ui Alignment MIDDLE_LEFT

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

Introduction

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

Prototype

Alignment MIDDLE_LEFT

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

Click Source Link

Usage

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

License:Apache License

protected void initActions() {
    // WW_TODO ?//from w  w  w . j a  v  a2 s.  co m
    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.organization.GroupMenuBar.java

License:Apache License

public void addButton(Button button) {
    button.addStyleName(ExplorerLayout.STYLE_TOOLBAR_BUTTON);

    actionButtons.add(button);/*ww w .j  a v a  2  s.co m*/
    // Button is added after the spacer
    addComponent(button);
    setComponentAlignment(button, Alignment.MIDDLE_LEFT);
}

From source file:com.klwork.explorer.ui.business.outproject.AbstractFlowManagerPage.java

License:Apache License

@Override
public HorizontalLayout createSelectHead() {
    HorizontalLayout tableHeadLayout = new HorizontalLayout();
    // tableHeadLayout.setSizeFull();
    tableHeadLayout.setSpacing(true);//from ww w . j a va2 s.c  om
    tableHeadLayout.setMargin(true);
    Resource pictureResource = Images.TASK_LIST;
    Embedded picture = new Embedded(null, pictureResource);
    picture.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_PICTURE);
    picture.setType(Embedded.TYPE_IMAGE);
    tableHeadLayout.addComponent(picture);
    tableHeadLayout.setComponentAlignment(picture, Alignment.MIDDLE_LEFT);

    Label nameLabel = createTitleLabel();
    nameLabel.addStyleName("taskListLabel");
    // nameLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD);
    tableHeadLayout.addComponent(nameLabel);
    tableHeadLayout.setComponentAlignment(nameLabel, Alignment.MIDDLE_LEFT);
    return tableHeadLayout;
}

From source file:com.klwork.explorer.ui.business.outproject.ProjectSearchPanel.java

License:Apache License

protected void initInputField() {
    // Csslayout is used to style inputtext as rounded
    //CssLayout csslayout2 = new CssLayout();
    CustomLayout csslayout = new CustomLayout("circularButton");
    //csslayout.setHeight(24, Unit.PIXELS);
    csslayout.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(csslayout);//from  ww  w  .  j a va2s  . c o m

    inputField = new TextField();
    inputField.setWidth(50, Unit.PERCENTAGE);
    inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
    inputField.setInputPrompt("??");
    inputField.focus();
    csslayout.addComponent(inputField, "searchInput");

    layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(csslayout, 1.0f);
}

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  w w.  j av a2s .  c o  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.SaveToNotePopupWindow.java

License:Apache License

public VerticalLayout initMainLayout(final SocialUserWeibo userWeibo) {
    return new VerticalLayout() {
        {//from w  ww  .  ja va 2 s . 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("");
            addComponent(descriptionField);
            // ?
            weiboContentTA = new TextArea("");
            weiboContentTA.setWidth("100%");
            weiboContentTA.setColumns(25);
            weiboContentTA.focus();
            addComponent(weiboContentTA);
            scheduleEventFieldGroup.bind(weiboContentTA, "content");

            if (hasOrginWeibo) {// 
                weiboContentTA.setValue("//@" + userWeibo.getUserScreenName() + ": " + userWeibo.getText());
            } else {
                weiboContentTA.setValue(userWeibo.getText());
                //+ mainPage.textTranslate(userWeibo.getText()));
            }

            //,
            addComponent(new VerticalLayout() {
                {
                    setSpacing(true);

                    TextField titleField = CommonFieldHandler.createTextField("");
                    scheduleEventFieldGroup.bind(titleField, "title");

                    //???
                    if (userWeibo.getText() != null && userWeibo.getText().length() > 10) {
                        titleField.setValue(userWeibo.getText().substring(0, 10));
                    }
                    addComponent(titleField);
                    // setSizeFull();
                    // setMargin(true);
                    SocialUserAccount noteAccount = socialUserAccountService
                            .findSocialUserByType(socialUserAccount.getOwnUser(), DictDef.dictInt("evernote"));
                    if (noteAccount != null) {
                        noteEntity.setUserAccountId(noteAccount.getId());
                    }

                    Map<String, String> map = socialEvernoteService.queryNotebook(noteAccount);
                    ComboBox noteMap = CommonFieldHandler.createComBox("", map, "");
                    addComponent(noteMap);
                    setComponentAlignment(noteMap, 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 = socialEvernoteService.saveWeiboToNotes(noteEntity);
                            if (ret == 1) {
                                Notification.show("??", Notification.Type.HUMANIZED_MESSAGE);
                            } else {
                                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;/*from w  w  w  .  j  a  v  a  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);
}

From source file:com.klwork.explorer.ui.content.email.EmailDetailPanel.java

License:Apache License

protected void addSimpleRow(String labelMessageKey, String content) {
    addLabel(labelMessageKey);/* w ww  .  j  av a  2 s . c  o  m*/

    Label subjectLabel = new Label(content);
    subjectLabel.setSizeUndefined();
    subjectLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD);

    gridLayout.addComponent(subjectLabel);
    gridLayout.setComponentAlignment(subjectLabel, Alignment.MIDDLE_LEFT);
}

From source file:com.klwork.explorer.ui.custom.SelectUsersPopupWindow.java

License:Apache License

protected void initSelectMyselfButton(HorizontalLayout searchLayout) {
    final LoggedInUser loggedInUser = LoginHandler.getLoggedInUser();
    if (ignoredUserIds == null || !ignoredUserIds.contains(loggedInUser.getId())) {
        Button meButton = new Button(i18nManager.getMessage(Messages.PEOPLE_SELECT_MYSELF));
        meButton.setIcon(Images.USER_16);
        searchLayout.addComponent(meButton);
        searchLayout.setComponentAlignment(meButton, Alignment.MIDDLE_LEFT);

        if (multiSelect) {
            meButton.addClickListener(new ClickListener() {
                public void buttonClick(ClickEvent event) {
                    selectUser(loggedInUser.getId(), loggedInUser.getFullName());
                }//from  ww w .java 2  s.  c  om
            });
        } else {
            meButton.addClickListener(new ClickListener() {
                public void buttonClick(ClickEvent event) {
                    addMatchingUser(loggedInUser.getId(), loggedInUser.getFullName());
                    matchingUsersTable.select(loggedInUser.getId());
                    fireEvent(new SubmitEvent(doneButton, SubmitEvent.SUBMITTED));
                    close();
                }
            });
        }
    }
}

From source file:com.klwork.explorer.ui.custom.TaskListHeader.java

License:Apache License

protected void initInputField() {
    // Csslayout is used to style inputtext as rounded
    //CssLayout csslayout2 = new CssLayout();
    CustomLayout csslayout = new CustomLayout("circularButton");
    csslayout.setHeight(24, Unit.PIXELS);
    csslayout.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(csslayout);//w  w  w  .j a v a  2s.  co  m

    inputField = new TextField();
    inputField.setWidth(100, Unit.PERCENTAGE);
    inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
    inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
    inputField.focus();
    csslayout.addComponent(inputField, "searchInput");

    layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(csslayout, 1.0f);
}