Example usage for com.vaadin.ui VerticalLayout VerticalLayout

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

Introduction

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

Prototype

public VerticalLayout() 

Source Link

Document

Constructs an empty VerticalLayout.

Usage

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

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    final Label organizationHeader = new Label(
            AppContext.getMessage(ProjectMemberI18nEnum.FORM_INFORMATION_SECTION));
    organizationHeader.setStyleName("h2");
    layout.addComponent(organizationHeader);

    this.informationLayout = new GridFormLayoutHelper(1, 2, "100%", "167px", Alignment.TOP_LEFT);
    this.informationLayout.getLayout().setWidth("100%");
    this.informationLayout.getLayout().setMargin(false);
    this.informationLayout.getLayout().addStyleName("colored-gridlayout");

    layout.addComponent(this.informationLayout.getLayout());
    return layout;
}

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

License:Open Source License

private Layout createBottomPanel() {
    VerticalLayout permissionsPanel = new VerticalLayout();
    final Label organizationHeader = new Label(AppContext.getMessage(ProjectRoleI18nEnum.SECTION_PERMISSIONS));
    organizationHeader.setStyleName("h2");
    permissionsPanel.addComponent(organizationHeader);

    projectFormHelper = new GridFormLayoutHelper(2, ProjectRolePermissionCollections.PROJECT_PERMISSIONS.length,
            "100%", "167px", Alignment.TOP_LEFT);
    projectFormHelper.getLayout().setWidth("100%");
    projectFormHelper.getLayout().setMargin(false);
    projectFormHelper.getLayout().addStyleName("colored-gridlayout");

    permissionsPanel.addComponent(projectFormHelper.getLayout());

    roleId = (Integer) roleComboBox.getValue();
    displayRolePermission(roleId);/*  w  w w. ja v a 2  s  .c  o  m*/

    return permissionsPanel;
}

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

License:Open Source License

private Component generateMemberBlock(final SimpleProjectMember member) {
    CssLayout memberBlock = new CssLayout();
    memberBlock.addStyleName("member-block");

    VerticalLayout blockContent = new VerticalLayout();
    MHorizontalLayout blockTop = new MHorizontalLayout();
    Image memberAvatar = UserAvatarControlFactory.createUserAvatarEmbeddedComponent(member.getMemberAvatarId(),
            100);/*from   w  w w . ja  v  a2s  . co m*/
    blockTop.addComponent(memberAvatar);

    VerticalLayout memberInfo = new VerticalLayout();

    Button deleteBtn = new Button("", FontAwesome.TRASH_O);
    deleteBtn.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent clickEvent) {
            ConfirmDialogExt.show(UI.getCurrent(),
                    AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE, SiteConfiguration.getSiteName()),
                    AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE),
                    AppContext.getMessage(GenericI18Enum.BUTTON_YES),
                    AppContext.getMessage(GenericI18Enum.BUTTON_NO), new ConfirmDialog.Listener() {
                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClose(ConfirmDialog dialog) {
                            if (dialog.isConfirmed()) {
                                ProjectMemberService prjMemberService = ApplicationContextUtil
                                        .getSpringBean(ProjectMemberService.class);
                                member.setStatus(ProjectMemberStatusConstants.INACTIVE);
                                prjMemberService.updateWithSession(member, AppContext.getUsername());

                                EventBusFactory.getInstance().post(
                                        new ProjectMemberEvent.GotoList(ProjectMemberListViewImpl.this, null));
                            }
                        }
                    });
        }
    });
    deleteBtn.addStyleName(UIConstants.BUTTON_ICON_ONLY);

    blockContent.addComponent(deleteBtn);
    deleteBtn.setVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS));
    blockContent.setComponentAlignment(deleteBtn, Alignment.TOP_RIGHT);

    LabelLink memberLink = new LabelLink(member.getMemberFullName(),
            ProjectLinkBuilder.generateProjectMemberFullLink(member.getProjectid(), member.getUsername()));

    memberLink.setWidth("100%");
    memberLink.addStyleName("member-name");

    memberInfo.addComponent(memberLink);

    String roleLink = "<a href=\"" + AppContext.getSiteUrl() + GenericLinkUtils.URL_PREFIX_PARAM
            + ProjectLinkGenerator.generateRolePreviewLink(member.getProjectid(), member.getProjectRoleId())
            + "\"";
    Label memberRole = new Label();
    memberRole.setContentMode(ContentMode.HTML);
    memberRole.setStyleName("member-role");
    if (member.isAdmin()) {
        memberRole.setValue(roleLink + "style=\"color: #B00000;\">" + "Project Admin" + "</a>");
    } else {
        memberRole.setValue(roleLink + "style=\"color:gray;font-size:12px;\">" + member.getRoleName() + "</a>");
    }
    memberRole.setSizeUndefined();
    memberInfo.addComponent(memberRole);

    Label memberEmailLabel = new Label(
            "<a href='mailto:" + member.getUsername() + "'>" + member.getUsername() + "</a>", ContentMode.HTML);
    memberEmailLabel.addStyleName("member-email");
    memberEmailLabel.setWidth("100%");
    memberInfo.addComponent(memberEmailLabel);

    Label memberSinceLabel = new Label("Member since: " + AppContext.formatDate(member.getJoindate()));
    memberSinceLabel.addStyleName("member-email");
    memberSinceLabel.setWidth("100%");
    memberInfo.addComponent(memberSinceLabel);

    if (RegisterStatusConstants.SENT_VERIFICATION_EMAIL.equals(member.getStatus())) {
        final VerticalLayout waitingNotLayout = new VerticalLayout();
        Label infoStatus = new Label(AppContext.getMessage(ProjectMemberI18nEnum.WAITING_ACCEPT_INVITATION));
        infoStatus.addStyleName("member-email");
        waitingNotLayout.addComponent(infoStatus);

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

                    @Override
                    public void buttonClick(ClickEvent event) {
                        ProjectMemberMapper projectMemberMapper = ApplicationContextUtil
                                .getSpringBean(ProjectMemberMapper.class);
                        member.setStatus(RegisterStatusConstants.VERIFICATING);
                        projectMemberMapper.updateByPrimaryKeySelective(member);
                        waitingNotLayout.removeAllComponents();
                        Label statusEmail = new Label(
                                AppContext.getMessage(ProjectMemberI18nEnum.SENDING_EMAIL_INVITATION));
                        statusEmail.addStyleName("member-email");
                        waitingNotLayout.addComponent(statusEmail);
                    }
                });
        resendInvitationLink.setStyleName("link");
        resendInvitationLink.addStyleName("member-email");
        waitingNotLayout.addComponent(resendInvitationLink);
        memberInfo.addComponent(waitingNotLayout);
    } else if (RegisterStatusConstants.ACTIVE.equals(member.getStatus())) {
        Label lastAccessTimeLbl = new Label("Logged in "
                + DateTimeUtils.getPrettyDateValue(member.getLastAccessTime(), AppContext.getUserLocale()));
        lastAccessTimeLbl.addStyleName("member-email");
        memberInfo.addComponent(lastAccessTimeLbl);
    } else if (RegisterStatusConstants.VERIFICATING.equals(member.getStatus())) {
        Label infoStatus = new Label(AppContext.getMessage(ProjectMemberI18nEnum.SENDING_EMAIL_INVITATION));
        infoStatus.addStyleName("member-email");
        memberInfo.addComponent(infoStatus);
    }

    String bugStatus = member.getNumOpenBugs() + " open bug";
    if (member.getNumOpenBugs() > 1) {
        bugStatus += "s";
    }

    String taskStatus = member.getNumOpenTasks() + " open task";
    if (member.getNumOpenTasks() > 1) {
        taskStatus += "s";
    }

    Label memberWorkStatus = new Label(bugStatus + " - " + taskStatus);
    memberInfo.addComponent(memberWorkStatus);
    memberInfo.setWidth("100%");

    blockTop.addComponent(memberInfo);
    blockTop.setExpandRatio(memberInfo, 1.0f);
    blockTop.setWidth("100%");
    blockContent.addComponent(blockTop);

    blockContent.setWidth("100%");

    memberBlock.addComponent(blockContent);
    return memberBlock;
}

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

License:Open Source License

public ProjectNotificationSettingViewComponent(final ProjectNotificationSetting bean) {
    super(AppContext.getMessage(ProjectSettingI18nEnum.VIEW_TITLE));

    VerticalLayout bodyWrapper = new VerticalLayout();
    bodyWrapper.setSpacing(true);//from   w  w w .  j av  a2  s  .c om
    bodyWrapper.setMargin(true);
    bodyWrapper.setSizeFull();

    HorizontalLayout notificationLabelWrapper = new HorizontalLayout();
    notificationLabelWrapper.setSizeFull();
    notificationLabelWrapper.setMargin(true);

    notificationLabelWrapper.setStyleName("notification-label");

    Label notificationLabel = new Label(AppContext.getMessage(ProjectSettingI18nEnum.EXT_LEVEL));
    notificationLabel.addStyleName("h2");

    notificationLabel.setHeightUndefined();
    notificationLabelWrapper.addComponent(notificationLabel);

    bodyWrapper.addComponent(notificationLabelWrapper);

    VerticalLayout body = new VerticalLayout();
    body.setSpacing(true);
    body.setMargin(new MarginInfo(true, false, false, false));

    final OptionGroup optionGroup = new OptionGroup(null);

    optionGroup.setItemCaptionMode(ItemCaptionMode.EXPLICIT);

    optionGroup.addItem(NotificationType.Default.name());
    optionGroup.setItemCaption(NotificationType.Default.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_DEFAULT_SETTING));

    optionGroup.addItem(NotificationType.None.name());
    optionGroup.setItemCaption(NotificationType.None.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_NONE_SETTING));

    optionGroup.addItem(NotificationType.Minimal.name());
    optionGroup.setItemCaption(NotificationType.Minimal.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_MINIMUM_SETTING));

    optionGroup.addItem(NotificationType.Full.name());
    optionGroup.setItemCaption(NotificationType.Full.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_MAXIMUM_SETTING));

    optionGroup.setHeight("100%");

    body.addComponent(optionGroup);
    body.setExpandRatio(optionGroup, 1.0f);
    body.setComponentAlignment(optionGroup, Alignment.MIDDLE_LEFT);

    String levelVal = bean.getLevel();
    if (levelVal == null) {
        optionGroup.select(NotificationType.Default.name());
    } else {
        optionGroup.select(levelVal);
    }

    Button updateBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_UPDATE_LABEL),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        bean.setLevel((String) optionGroup.getValue());
                        ProjectNotificationSettingService projectNotificationSettingService = ApplicationContextUtil
                                .getSpringBean(ProjectNotificationSettingService.class);

                        if (bean.getId() == null) {
                            projectNotificationSettingService.saveWithSession(bean, AppContext.getUsername());
                        } else {
                            projectNotificationSettingService.updateWithSession(bean, AppContext.getUsername());
                        }
                        NotificationUtil.showNotification(
                                AppContext.getMessage(ProjectSettingI18nEnum.DIALOG_UPDATE_SUCCESS));
                    } catch (Exception e) {
                        throw new MyCollabException(e);
                    }
                }
            });
    updateBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    updateBtn.setIcon(FontAwesome.REFRESH);
    body.addComponent(updateBtn);
    body.setComponentAlignment(updateBtn, Alignment.BOTTOM_LEFT);

    bodyWrapper.addComponent(body);
    this.addComponent(bodyWrapper);

}

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

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    final VerticalLayout permissionsPanel = new VerticalLayout();
    final Label organizationHeader = new Label(AppContext.getMessage(ProjectRoleI18nEnum.SECTION_PERMISSIONS));
    organizationHeader.setStyleName("h2");
    permissionsPanel.addComponent(organizationHeader);

    PermissionMap perMap;//w ww . ja  v a  2s . c  om
    if (beanItem instanceof SimpleProjectRole) {
        perMap = ((SimpleProjectRole) beanItem).getPermissionMap();
    } else {
        perMap = new PermissionMap();
    }

    final GridFormLayoutHelper permissionFormHelper = new GridFormLayoutHelper(2,
            ProjectRolePermissionCollections.PROJECT_PERMISSIONS.length, "100%", "167px", Alignment.TOP_LEFT);

    for (int i = 0; i < ProjectRolePermissionCollections.PROJECT_PERMISSIONS.length; i++) {
        final String permissionPath = ProjectRolePermissionCollections.PROJECT_PERMISSIONS[i];
        final AccessPermissionComboBox permissionBox = new AccessPermissionComboBox();

        final Integer flag = perMap.getPermissionFlag(permissionPath);
        permissionBox.setValue(flag);
        permissionControlsMap.put(permissionPath, permissionBox);
        permissionFormHelper.addComponent(permissionBox,
                AppContext.getMessage(RolePermissionI18nEnum.valueOf(permissionPath)), 0, i);
    }

    permissionFormHelper.getLayout().setWidth("100%");
    permissionFormHelper.getLayout().setMargin(false);
    permissionFormHelper.getLayout().addStyleName("colored-gridlayout");
    permissionsPanel.addComponent(permissionFormHelper.getLayout());

    return permissionsPanel;
}

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

License:Open Source License

@Override
public ComponentContainer getLayout() {
    final VerticalLayout layout = new VerticalLayout();
    final Label organizationHeader = new Label("Role Information");
    organizationHeader.setStyleName("h2");
    layout.addComponent(organizationHeader);

    this.informationLayout = new GridFormLayoutHelper(2, 2, "100%", "167px", Alignment.TOP_LEFT);
    this.informationLayout.getLayout().setWidth("100%");
    this.informationLayout.getLayout().setMargin(false);
    this.informationLayout.getLayout().addStyleName("colored-gridlayout");

    layout.addComponent(this.informationLayout.getLayout());
    return layout;
}

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

License:Open Source License

public ProjectRoleListViewImpl() {
    this.setMargin(new MarginInfo(false, true, false, true));

    this.searchPanel = new ProjectRoleSearchPanel();
    addComponent(this.searchPanel);

    this.listLayout = new VerticalLayout();
    addComponent(this.listLayout);

    this.generateDisplayTable();
}

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

License:Open Source License

protected ComponentContainer createBottomPanel() {
    VerticalLayout permissionsPanel = new VerticalLayout();
    final Label organizationHeader = new Label(AppContext.getMessage(ProjectRoleI18nEnum.SECTION_PERMISSIONS));
    organizationHeader.setStyleName("h2");
    permissionsPanel.addComponent(organizationHeader);

    projectFormHelper = new GridFormLayoutHelper(2, ProjectRolePermissionCollections.PROJECT_PERMISSIONS.length,
            "100%", "167px", Alignment.TOP_LEFT);
    projectFormHelper.getLayout().setWidth("100%");
    projectFormHelper.getLayout().setMargin(false);
    projectFormHelper.getLayout().addStyleName("colored-gridlayout");

    permissionsPanel.addComponent(projectFormHelper.getLayout());

    return permissionsPanel;
}

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

License:Open Source License

public VersionListViewImpl() {
    this.setMargin(new MarginInfo(false, true, true, true));
    this.versionSearchPanel = new VersionSearchPanel();
    this.versionListLayout = new VerticalLayout();
    this.with(versionSearchPanel, versionListLayout);
    this.generateDisplayTable();
}

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

License:Open Source License

public FilterTaskViewImpl() {
    this.setMargin(new MarginInfo(false, true, true, true));
    final HorizontalLayout header = new HorizontalLayout();
    header.setSpacing(true);//from  w  w w.  j  a  va2  s  . c om
    header.setMargin(new MarginInfo(true, false, true, false));
    header.setStyleName(UIConstants.HEADER_VIEW);
    header.setWidth("100%");
    Image titleIcon = new Image(null, MyCollabResource.newResource("icons/24/project/task.png"));

    headerText = new Label();
    headerText.setSizeUndefined();
    headerText.setStyleName(UIConstants.HEADER_TEXT);

    Button backtoTaskListBtn = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_BACK_TO_DASHBOARD),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    EventBusFactory.getInstance().post(new TaskListEvent.GotoTaskListScreen(this, null));

                }
            });
    backtoTaskListBtn.setStyleName(UIConstants.THEME_GREEN_LINK);

    UiUtils.addComponent(header, titleIcon, Alignment.TOP_LEFT);
    UiUtils.addComponent(header, headerText, Alignment.MIDDLE_LEFT);
    UiUtils.addComponent(header, backtoTaskListBtn, Alignment.MIDDLE_RIGHT);
    header.setExpandRatio(headerText, 1.0f);

    this.addComponent(header);

    HorizontalLayout contentLayout = new HorizontalLayout();
    contentLayout.setWidth("100%");
    contentLayout.setSpacing(true);
    this.addComponent(contentLayout);

    this.taskTableDisplay = new TaskTableDisplay(Arrays.asList(TaskTableFieldDef.taskname,
            TaskTableFieldDef.startdate, TaskTableFieldDef.duedate, TaskTableFieldDef.percentagecomplete));

    this.taskTableDisplay.addTableListener(new TableClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void itemClick(final TableClickEvent event) {
            final SimpleTask task = (SimpleTask) event.getData();
            if ("taskname".equals(event.getFieldName())) {
                EventBusFactory.getInstance()
                        .post(new TaskEvent.GotoRead(FilterTaskViewImpl.this, task.getId()));
            }
        }
    });
    taskTableDisplay.setWidth("100%");
    taskTableDisplay.setStyleName("filter-task-table");

    leftColumn = new VerticalLayout();
    leftColumn.addComponent(taskTableDisplay);
    leftColumn.setStyleName("depotComp");
    leftColumn.setMargin(new MarginInfo(true, true, false, false));

    rightColumn = new VerticalLayout();
    rightColumn.setWidth("300px");
    contentLayout.addComponent(leftColumn);
    contentLayout.addComponent(rightColumn);
    contentLayout.setExpandRatio(leftColumn, 1.0f);
    unresolvedTaskByAssigneeWidget = new UnresolvedTaskByAssigneeWidget();
    rightColumn.addComponent(unresolvedTaskByAssigneeWidget);

    unresolvedTaskByPriorityWidget = new UnresolvedTaskByPriorityWidget();
    rightColumn.addComponent(unresolvedTaskByPriorityWidget);
}