Example usage for com.vaadin.ui VerticalLayout setWidth

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

Introduction

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

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

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.ReOpenView.java

License:Open Source License

private void constructUI() {
    VerticalLayout contentLayout = new VerticalLayout();
    contentLayout.setWidth("100%");
    contentLayout.addComponent(this.editForm);

    final Button reOpenBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_REOPEN),
            new Button.ClickListener() {
                @Override/*from   w  w w.  j  av  a 2s  . c  o m*/
                public void buttonClick(final Button.ClickEvent event) {

                    if (editForm.validateForm()) {
                        ReOpenView.this.bug.setStatus(BugStatus.ReOpened.name());

                        // Save bug status and assignee
                        final BugService bugService = ApplicationContextUtil.getSpringBean(BugService.class);
                        bugService.updateSelectiveWithSession(ReOpenView.this.bug, AppContext.getUsername());

                        // Save comment
                        final String commentValue = editForm.commentArea.getValue();
                        if (commentValue != null && !commentValue.trim().equals("")) {
                            final Comment comment = new Comment();
                            comment.setComment(commentValue);
                            comment.setCreatedtime(new GregorianCalendar().getTime());
                            comment.setCreateduser(AppContext.getUsername());
                            comment.setSaccountid(AppContext.getAccountId());
                            comment.setType(CommentType.PRJ_BUG.toString());
                            comment.setTypeid("" + ReOpenView.this.bug.getId());
                            comment.setExtratypeid(CurrentProjectVariables.getProjectId());

                            final CommentService commentService = ApplicationContextUtil
                                    .getSpringBean(CommentService.class);
                            commentService.saveWithSession(comment, AppContext.getUsername());
                        }
                        ReOpenView.this.callbackForm.previewItem(bug);
                        EventBusFactory.getInstance().post(new ShellEvent.NavigateBack(this, null));
                    }

                }
            });
    reOpenBtn.setStyleName("save-btn");
    this.setRightComponent(reOpenBtn);

    this.setContent(contentLayout);
}

From source file:com.esofthead.mycollab.mobile.module.project.view.message.MessageAddViewImpl.java

License:Open Source License

public MessageAddViewImpl() {
    this.addStyleName("message-add-view");
    this.setCaption(AppContext.getMessage(MessageI18nEnum.M_VIEW_ADD_TITLE));

    this.content = new CssLayout();
    this.content.setStyleName("content-layout");
    this.content.setSizeFull();
    this.setContent(this.content);

    VerticalLayout addFormLayout = new VerticalLayout();
    addFormLayout.setStyleName("addform-layout");
    addFormLayout.setWidth("100%");

    subjectField = new TextField();
    subjectField.setStyleName("title-field");
    subjectField.setWidth("100%");
    subjectField.setInputPrompt(AppContext.getMessage(MessageI18nEnum.FORM_TITLE));
    addFormLayout.addComponent(subjectField);

    contentField = new TextArea();
    contentField.setStyleName("content-field");
    contentField.setWidth("100%");
    contentField.setInputPrompt(AppContext.getMessage(MessageI18nEnum.M_FORM_CONTENT_FIELD_PROMPT));
    addFormLayout.addComponent(contentField);

    VerticalComponentGroup bottomRow = new VerticalComponentGroup();
    bottomRow.setStyleName("bottom-row");
    bottomRow.setWidth("100%");
    isStickField = new Switch(AppContext.getMessage(MessageI18nEnum.FORM_IS_STICK), false);
    bottomRow.addComponent(isStickField);

    attachment = new MessageAttachmentField();

    attachment.setCaption(null);/*from   ww  w  . j ava 2 s. c  o  m*/
    bottomRow.addComponent(attachment);

    this.content.addComponent(addFormLayout);

    this.content.addComponent(bottomRow);

    this.saveBtn = new Button(AppContext.getMessage(GenericI18Enum.M_BUTTON_DONE));
    this.saveBtn.addStyleName("save-btn");
    this.saveBtn.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -2038682412445718948L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            final SimpleMessage message = new SimpleMessage();
            message.setProjectid(CurrentProjectVariables.getProjectId());
            message.setPosteddate(new GregorianCalendar().getTime());
            if (!subjectField.getValue().toString().trim().equals("")) {
                message.setTitle(subjectField.getValue());
                message.setMessage(contentField.getValue());
                message.setPosteduser(AppContext.getUsername());
                message.setSaccountid(AppContext.getAccountId());
                message.setIsstick(isStickField.getValue());
                MessageAddViewImpl.this.fireSaveItem(message);

            } else {
                subjectField.addStyleName("errorField");
                NotificationUtil.showErrorNotification(
                        AppContext.getMessage(MessageI18nEnum.FORM_TITLE_REQUIRED_ERROR));
            }
        }
    });
    this.setRightComponent(saveBtn);
}

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

License:Open Source License

@Override
public void displayDashboard() {
    mainLayout.removeAllComponents();//from w  w w .  j av a  2 s .c  o m
    SimpleProject currentProject = CurrentProjectVariables.getProject();
    VerticalLayout projectInfo = new VerticalLayout();
    projectInfo.setStyleName("project-info-layout");
    projectInfo.setWidth("100%");
    projectInfo.setDefaultComponentAlignment(Alignment.TOP_CENTER);

    Label projectIcon = new Label("<span aria-hidden=\"true\" data-icon=\"&#xe614\"></span>");
    projectIcon.setStyleName("project-icon");
    projectIcon.setContentMode(ContentMode.HTML);
    projectIcon.setWidthUndefined();
    projectInfo.addComponent(projectIcon);

    Label projectName = new Label(StringUtils.trim(currentProject.getName(), 50, true));
    projectName.setWidth("100%");
    projectName.setStyleName("project-name");
    projectInfo.addComponent(projectName);

    GridLayout projectModulesList = new GridLayout(2, 3);
    projectModulesList.setStyleName("project-modules-layout");
    projectModulesList.setWidth("100%");
    projectModulesList.setSpacing(true);
    projectModulesList.setDefaultComponentAlignment(Alignment.TOP_CENTER);

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MESSAGE), "&#xf04f;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MILESTONE), "&#xf075;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_TASK), "&#xe60f;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_BUG), "&#xf188;"));

    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_FILE), "&#xf017;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_RISK), "&#xf02d;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_PROBLEM), "&#xf0d2;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_TIME), "&#xe612;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_STANDAUP), "&#xf0c0;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_USERS), "&#xe601;"), 0, 2,
            1, 2);

    mainLayout.addComponent(projectInfo);
    mainLayout.addComponent(projectModulesList);
}

From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectLoginViewImpl.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);/*from ww w .  ja  v  a  2  s  . co m*/
    contentLayout.setSpacing(true);
    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 Projects");
    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 ProjectEvent.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.project.view.settings.ProjectMemberInviteViewImpl.java

License:Open Source License

private void constructUI() {
    this.roleComboBox = new ProjectRoleComboBox();
    this.roleComboBox.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override//  w  w  w .j  a  v a  2 s  . co  m
        public void valueChange(ValueChangeEvent event) {
            Integer roleId = (Integer) roleComboBox.getValue();
            displayRolePermission(roleId);
        }
    });
    roleComboBox.setCaption(AppContext.getMessage(ProjectMemberI18nEnum.FORM_ROLE));

    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setStyleName("main-layout");
    mainLayout.addStyleName("editview-layout");
    mainLayout.setWidth("100%");

    inviteFormLayout = new VerticalComponentGroup();
    inviteFormLayout.setWidth("100%");

    inviteEmailField = new EmailField();
    inviteEmailField.setCaption(AppContext.getMessage(ProjectMemberI18nEnum.M_FORM_EMAIL));
    inviteFormLayout.addComponent(inviteEmailField);

    messageArea = new TextArea();
    messageArea.setValue(AppContext.getMessage(ProjectMemberI18nEnum.MSG_DEFAULT_INVITATION_COMMENT));
    messageArea.setCaption(AppContext.getMessage(ProjectMemberI18nEnum.FORM_MESSAGE));
    inviteFormLayout.addComponent(messageArea);

    inviteFormLayout.addComponent(roleComboBox);

    mainLayout.addComponent(inviteFormLayout);

    Label permissionSectionHdr = new Label(AppContext.getMessage(ProjectRoleI18nEnum.SECTION_PERMISSIONS));
    permissionSectionHdr.setStyleName("h2");
    mainLayout.addComponent(permissionSectionHdr);

    permissionsPanel = new VerticalComponentGroup();
    mainLayout.addComponent(permissionsPanel);

    Button inviteBtn = new Button(AppContext.getMessage(ProjectMemberI18nEnum.BUTTON_NEW_INVITEE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    if (inviteEmailField.getValue() == "") {
                        return;
                    }
                    ProjectMemberInviteViewImpl.this.roleId = (Integer) roleComboBox.getValue();
                    ProjectMemberInviteViewImpl.this
                            .fireEvent(new ViewEvent<ProjectMemberEvent.InviteProjectMembers>(
                                    ProjectMemberInviteViewImpl.this,
                                    new ProjectMemberEvent.InviteProjectMembers(
                                            Arrays.asList(inviteEmailField.getValue()),
                                            ProjectMemberInviteViewImpl.this.roleId, messageArea.getValue())));

                }
            });
    inviteBtn.addStyleName("save-btn");
    this.setRightComponent(inviteBtn);
    this.setContent(mainLayout);
}

From source file:com.esofthead.mycollab.mobile.module.user.view.LoginViewImpl.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);//from   w ww.  j  a v  a 2 s . co  m
    contentLayout.setSpacing(true);
    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%");
    welcomeTextWrapper.setHeight("15px");
    Label welcomeText = new Label("Welcome Back!");
    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) {
            ShellController.doLogin(emailField.getValue(), pwdField.getValue(), 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.shell.ui.MainView.java

License:Open Source License

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

    VerticalLayout contentLayout = new VerticalLayout();
    contentLayout.setStyleName("content-wrapper");
    contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    contentLayout.setMargin(true);/*  ww w  .j  av  a  2s  .c om*/
    contentLayout.setSpacing(true);
    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%");
    welcomeTextWrapper.setHeight("15px");
    contentLayout.addComponent(welcomeTextWrapper);

    ModuleButton crmButton = new ModuleButton(AppContext.getMessage(GenericI18Enum.MODULE_CRM));
    crmButton.setWidth("100%");
    crmButton.addStyleName("crm");
    crmButton.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -1218427186205574547L;

        @Override
        public void buttonClick(ClickEvent event) {
            EventBusFactory.getInstance().post(new ShellEvent.GotoCrmModule(this, null));
        }
    });

    contentLayout.addComponent(crmButton);

    ModuleButton pmButton = new ModuleButton(AppContext.getMessage(GenericI18Enum.MODULE_PROJECT));
    pmButton.setWidth("100%");
    pmButton.addStyleName("project");
    pmButton.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -5323408319082242586L;

        @Override
        public void buttonClick(ClickEvent event) {
            EventBusFactory.getInstance().post(new ShellEvent.GotoProjectModule(this, null));
        }
    });
    contentLayout.addComponent(pmButton);

    ModuleButton fileButton = new ModuleButton(AppContext.getMessage(GenericI18Enum.MODULE_DOCUMENT));
    fileButton.setWidth("100%");
    fileButton.addStyleName("document");
    contentLayout.addComponent(fileButton);

    this.addComponent(contentLayout);
}

From source file:com.esofthead.mycollab.mobile.ui.ConfirmDialog.java

License:Open Source License

private void constructUI(final String message, final String okCaption, final String cancelCaption) {
    VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setHeightUndefined();//w ww.j  av  a  2s  .c  om
    layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);

    VerticalLayout messageWrapper = new VerticalLayout();
    messageWrapper.setStyleName("message-wrapper");
    messageWrapper.setWidth("100%");
    messageWrapper.setMargin(true);

    final Label messageDisplay = new Label(message);
    messageDisplay.setWidth("100%");
    messageWrapper.addComponent(messageDisplay);
    layout.addComponent(messageWrapper);

    HorizontalLayout controlBtn = new HorizontalLayout();
    controlBtn.setWidth("100%");

    final Button okBtn = new Button(okCaption);
    okBtn.setWidth("100%");
    okBtn.setHeight("35px");
    final Button cancelBtn = new Button(cancelCaption);
    cancelBtn.setWidth("100%");
    cancelBtn.setHeight("35px");

    Button.ClickListener listener = new Button.ClickListener() {
        private static final long serialVersionUID = -8306231710367659086L;

        @Override
        public void buttonClick(ClickEvent event) {
            ConfirmDialog.this.setConfirmed(event.getButton() == okBtn);
            if (ConfirmDialog.this.getListener() != null) {
                ConfirmDialog.this.getListener().onClose(ConfirmDialog.this);
            }
            ConfirmDialog.this.close();
        }

    };

    okBtn.addClickListener(listener);
    cancelBtn.addClickListener(listener);

    controlBtn.addComponent(cancelBtn);
    controlBtn.addComponent(okBtn);

    layout.addComponent(controlBtn);
    this.setContent(layout);
}