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.esofthead.mycollab.module.project.view.bug.ComponentSearchPanel.java

License:Open Source License

private HorizontalLayout createSearchTopPanel() {
    final MHorizontalLayout layout = new MHorizontalLayout().withWidth("100%").withSpacing(true)
            .withStyleName(UIConstants.HEADER_VIEW).withMargin(new MarginInfo(true, false, true, false));

    final Label componenttitle = new ProjectViewHeader(ProjectTypeConstants.BUG_COMPONENT,
            AppContext.getMessage(ComponentI18nEnum.VIEW_LIST_TITLE));
    componenttitle.setStyleName(UIConstants.HEADER_TEXT);

    layout.with(componenttitle).withAlign(componenttitle, Alignment.MIDDLE_LEFT).expand(componenttitle);

    final Button createBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_COMPONENT),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override/*from www .j ava2s  .c om*/
                public void buttonClick(final Button.ClickEvent event) {
                    EventBusFactory.getInstance().post(new BugComponentEvent.GotoAdd(this, null));
                }
            });
    createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.COMPONENTS));
    createBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    createBtn.setIcon(FontAwesome.PLUS);

    layout.with(createBtn).withAlign(createBtn, Alignment.MIDDLE_RIGHT);

    return layout;
}

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

License:Open Source License

public void display() {
    this.withMargin(new MarginInfo(true, false, true, false));
    this.setWidth("100%");
    this.addStyleName("tm-container");

    MHorizontalLayout headerLayout = new MHorizontalLayout()
            .withMargin(new MarginInfo(false, true, false, true));
    ELabel titleLbl = ELabel.h2("Phase Timeline");

    final CheckBox includeNoDateSet = new CheckBox("No date set");
    includeNoDateSet.setValue(false);//from   w w  w .  j a va 2 s .c o m

    final CheckBox includeClosedMilestone = new CheckBox("Closed phase");
    includeClosedMilestone.setValue(false);

    includeNoDateSet.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
            displayTimelines(includeNoDateSet.getValue(), includeClosedMilestone.getValue());
        }
    });
    includeClosedMilestone.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            displayTimelines(includeNoDateSet.getValue(), includeClosedMilestone.getValue());
        }
    });
    headerLayout.with(titleLbl, includeNoDateSet, includeClosedMilestone).expand(titleLbl)
            .withAlign(includeNoDateSet, Alignment.MIDDLE_RIGHT)
            .withAlign(includeClosedMilestone, Alignment.MIDDLE_RIGHT);

    MilestoneSearchCriteria searchCriteria = new MilestoneSearchCriteria();
    UserDashboardView userDashboardView = UIUtils.getRoot(this, UserDashboardView.class);
    searchCriteria.setProjectIds(new SetSearchField<>(userDashboardView.getInvolvedProjectKeys()));
    searchCriteria.setOrderFields(
            Collections.singletonList(new SearchCriteria.OrderField(Milestone.Field.enddate.name(), "ASC")));
    MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class);
    milestones = milestoneService
            .findPagableListByCriteria(new BasicSearchRequest<>(searchCriteria, 0, Integer.MAX_VALUE));

    this.addComponent(headerLayout);
    timelineContainer = new CssLayout();
    timelineContainer.setWidth("100%");
    this.addComponent(timelineContainer);
    timelineContainer.addStyleName("tm-wrapper");
    displayTimelines(false, false);
}

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

License:Open Source License

public MilestoneAddWindow(final SimpleMilestone milestone) {
    if (milestone.getId() == null) {
        setCaption("New milestone");
    } else {/*from www.j a  va 2  s  . c  o  m*/
        setCaption("Edit milestone");
    }
    this.setWidth("800px");
    this.setModal(true);
    this.setResizable(false);
    VerticalLayout content = new VerticalLayout();
    this.setContent(content);
    final AdvancedEditBeanForm<SimpleMilestone> editForm = new AdvancedEditBeanForm<>();
    content.addComponent(editForm);
    editForm.setFormLayoutFactory(new DefaultDynaFormLayout(ProjectTypeConstants.MILESTONE,
            MilestoneDefaultFormLayoutFactory.getForm(), Milestone.Field.id.name()));
    final MilestoneEditFormFieldFactory milestoneEditFormFieldFactory = new MilestoneEditFormFieldFactory(
            editForm);
    editForm.setBeanFormFieldFactory(milestoneEditFormFieldFactory);
    editForm.setBean(milestone);

    MHorizontalLayout buttonControls = new MHorizontalLayout()
            .withMargin(new MarginInfo(true, true, true, false));
    buttonControls.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);

    Button updateAllBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_UPDATE_OTHER_FIELDS),
            new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent clickEvent) {
                    EventBusFactory.getInstance()
                            .post(new MilestoneEvent.GotoAdd(MilestoneAddWindow.this, milestone));
                    close();
                }
            });
    updateAllBtn.addStyleName(UIConstants.BUTTON_LINK);

    Button saveBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SAVE), new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            if (editForm.validateForm()) {
                MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class);
                Integer milestoneId;
                if (milestone.getId() == null) {
                    milestoneId = milestoneService.saveWithSession(milestone, AppContext.getUsername());
                } else {
                    milestoneService.updateWithSession(milestone, AppContext.getUsername());
                    milestoneId = milestone.getId();
                }

                AttachmentUploadField uploadField = milestoneEditFormFieldFactory.getAttachmentUploadField();
                String attachPath = AttachmentUtils.getProjectEntityAttachmentPath(AppContext.getAccountId(),
                        milestone.getProjectid(), ProjectTypeConstants.MILESTONE, "" + milestone.getId());
                uploadField.saveContentsToRepo(attachPath);

                EventBusFactory.getInstance()
                        .post(new MilestoneEvent.NewMilestoneAdded(MilestoneAddWindow.this, milestoneId));
                EventBusFactory.getInstance().post(new AssignmentEvent.NewAssignmentAdd(MilestoneAddWindow.this,
                        ProjectTypeConstants.MILESTONE, milestoneId));
                close();
            }
        }
    });
    saveBtn.setIcon(FontAwesome.SAVE);
    saveBtn.setStyleName(UIConstants.BUTTON_ACTION);
    saveBtn.setClickShortcut(ShortcutAction.KeyCode.ENTER);

    Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL),
            new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent clickEvent) {
                    close();
                }
            });
    cancelBtn.setStyleName(UIConstants.BUTTON_OPTION);
    buttonControls.with(updateAllBtn, cancelBtn, saveBtn);
    content.addComponent(buttonControls);
    content.setComponentAlignment(buttonControls, Alignment.MIDDLE_RIGHT);
}

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

License:Open Source License

private void constructHeader() {
    final HorizontalLayout header = new HorizontalLayout();
    header.setSpacing(true);/*w ww . j  a  v  a2  s  . c  o  m*/
    header.setWidth("100%");
    final Label taskGroupSelection = new Label(AppContext.getMessage(MilestoneI18nEnum.TAB_RELATED_BUGS));
    taskGroupSelection.addStyleName("h2");
    taskGroupSelection.addStyleName(UIConstants.THEME_NO_BORDER);
    header.addComponent(taskGroupSelection);
    header.setExpandRatio(taskGroupSelection, 1.0f);
    header.setComponentAlignment(taskGroupSelection, Alignment.MIDDLE_LEFT);

    this.viewGroup = new ToggleButtonGroup();

    final Button simpleDisplay = new Button(null, new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            MilestoneBugListComp.this.displaySimpleView();
        }
    });
    simpleDisplay.setIcon(MyCollabResource.newResource("icons/16/project/list_display.png"));

    this.viewGroup.addButton(simpleDisplay);

    final Button advanceDisplay = new Button(null, new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            MilestoneBugListComp.this.displayAdvancedView();
        }
    });
    advanceDisplay.setIcon(MyCollabResource.newResource("icons/16/project/bug_advanced_display.png"));
    this.viewGroup.addButton(advanceDisplay);
    header.addComponent(this.viewGroup);
    header.setComponentAlignment(this.viewGroup, Alignment.MIDDLE_RIGHT);
    this.addComponent(header);
}

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

License:Open Source License

private HorizontalLayout createHeaderRight() {
    final HorizontalLayout layout = new HorizontalLayout();

    this.createBtn = new Button(AppContext.getMessage(MilestoneI18nEnum.BUTTON_NEW_PHASE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override/* ww  w .  ja v  a2s. c o  m*/
                public void buttonClick(final ClickEvent event) {
                    EventBusFactory.getInstance()
                            .post(new MilestoneEvent.GotoAdd(MilestoneListViewImpl.this, null));
                }
            });

    this.createBtn.setIcon(FontAwesome.PLUS);
    this.createBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    this.createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES));
    layout.addComponent(this.createBtn);
    layout.setComponentAlignment(this.createBtn, Alignment.MIDDLE_RIGHT);

    return layout;
}

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

License:Open Source License

public void display() {
    this.setWidth("100%");
    this.addStyleName("tm-container");

    MHorizontalLayout headerLayout = new MHorizontalLayout();
    ELabel titleLbl = ELabel.h2("Phase Timeline");

    final CheckBox noDateSetMilestone = new CheckBox("No date set");
    noDateSetMilestone.setValue(false);/*from  www  .j  a v a2  s. co  m*/

    final CheckBox includeClosedMilestone = new CheckBox("Closed phase");
    includeClosedMilestone.setValue(false);

    noDateSetMilestone.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
            displayTimelines(noDateSetMilestone.getValue(), includeClosedMilestone.getValue());
        }
    });
    includeClosedMilestone.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            displayTimelines(noDateSetMilestone.getValue(), includeClosedMilestone.getValue());
        }
    });
    headerLayout.with(titleLbl, noDateSetMilestone, includeClosedMilestone).expand(titleLbl)
            .withAlign(noDateSetMilestone, Alignment.MIDDLE_RIGHT)
            .withAlign(includeClosedMilestone, Alignment.MIDDLE_RIGHT);

    MilestoneSearchCriteria searchCriteria = new MilestoneSearchCriteria();
    searchCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
    searchCriteria.setOrderFields(
            Collections.singletonList(new SearchCriteria.OrderField(Milestone.Field.enddate.name(), "ASC")));
    MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class);
    milestones = milestoneService
            .findPagableListByCriteria(new BasicSearchRequest<>(searchCriteria, 0, Integer.MAX_VALUE));

    this.addComponent(headerLayout);
    timelineContainer = new CssLayout();
    timelineContainer.setWidth("100%");
    this.addComponent(timelineContainer);
    timelineContainer.addStyleName("tm-wrapper");
    displayTimelines(false, false);
}

From source file:com.esofthead.mycollab.module.project.view.page.PageListViewImpl.java

License:Open Source License

private void initHeader() {
    Label headerText = new ProjectViewHeader(ProjectTypeConstants.PAGE,
            AppContext.getMessage(Page18InEnum.VIEW_LIST_TITLE));

    headerLayout.with(headerText).alignAll(Alignment.MIDDLE_LEFT).expand(headerText);

    Label sortLbl = new Label(AppContext.getMessage(Page18InEnum.OPT_SORT_LABEL));
    sortLbl.setSizeUndefined();//from  ww w .j  a va  2  s. co  m
    headerLayout.with(sortLbl).withAlign(sortLbl, Alignment.MIDDLE_RIGHT);

    ToggleButtonGroup sortGroup = new ToggleButtonGroup();
    headerLayout.with(sortGroup).withAlign(sortGroup, Alignment.MIDDLE_RIGHT);

    SortButton sortDateBtn = new SortButton(AppContext.getMessage(Page18InEnum.OPT_SORT_BY_DATE),
            new Button.ClickListener() {

                private static final long serialVersionUID = -6987503077975316907L;

                @Override
                public void buttonClick(Button.ClickEvent event) {
                    dateSourceAscend = !dateSourceAscend;
                    if (dateSourceAscend) {
                        Collections.sort(resources, Ordering.from(dateSort));
                    } else {
                        Collections.sort(resources, Ordering.from(dateSort).reverse());
                    }
                    displayPages(resources);

                }
            });
    sortGroup.addButton(sortDateBtn);

    SortButton sortNameBtn = new SortButton(AppContext.getMessage(Page18InEnum.OPT_SORT_BY_NAME),
            new Button.ClickListener() {

                private static final long serialVersionUID = 2847554379518387585L;

                @Override
                public void buttonClick(Button.ClickEvent event) {
                    nameSortAscend = !nameSortAscend;
                    if (nameSortAscend) {
                        Collections.sort(resources, Ordering.from(nameSort));
                    } else {
                        Collections.sort(resources, Ordering.from(nameSort).reverse());
                    }
                    displayPages(resources);

                }
            });
    sortGroup.addButton(sortNameBtn);

    SortButton sortKindBtn = new SortButton(AppContext.getMessage(Page18InEnum.OPT_SORT_BY_KIND),
            new Button.ClickListener() {

                private static final long serialVersionUID = 2230933690084074590L;

                @Override
                public void buttonClick(Button.ClickEvent event) {
                    kindSortAscend = !kindSortAscend;
                    if (kindSortAscend) {
                        Collections.sort(resources, Ordering.from(kindSort));
                    } else {
                        Collections.sort(resources, Ordering.from(kindSort).reverse());
                    }
                    displayPages(resources);

                }
            });
    sortGroup.addButton(sortKindBtn);

    sortGroup.setDefaultButton(sortDateBtn);

    final Button newGroupBtn = new Button(AppContext.getMessage(Page18InEnum.BUTTON_NEW_GROUP),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(final Button.ClickEvent event) {
                    UI.getCurrent().addWindow(new PageGroupWindow());
                }
            });
    newGroupBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    newGroupBtn.setIcon(FontAwesome.PLUS);
    newGroupBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PAGES));
    headerLayout.with(newGroupBtn).withAlign(newGroupBtn, Alignment.MIDDLE_RIGHT);

    final Button newPageBtn = new Button(AppContext.getMessage(Page18InEnum.BUTTON_NEW_PAGE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(final Button.ClickEvent event) {
                    EventBusFactory.getInstance().post(new PageEvent.GotoAdd(this, null));
                }
            });
    newPageBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    newPageBtn.setIcon(FontAwesome.PLUS);
    newPageBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PAGES));

    headerText.setStyleName(UIConstants.HEADER_TEXT);
    headerLayout.with(newPageBtn).withAlign(newPageBtn, Alignment.MIDDLE_RIGHT);
}

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

License:Open Source License

public ProjectAddBaseTemplateWindow() {
    super(AppContext.getMessage(ProjectI18nEnum.OPT_CREATE_PROJECT_FROM_TEMPLATE));
    this.setModal(true);
    this.setClosable(true);
    this.setResizable(false);
    this.setWidth("550px");
    MVerticalLayout content = new MVerticalLayout();
    GridFormLayoutHelper gridFormLayoutHelper = GridFormLayoutHelper.defaultFormLayoutHelper(1, 3);
    final TemplateProjectComboBox templateProjectComboBox = new TemplateProjectComboBox();
    Button helpBtn = new Button("");
    helpBtn.setIcon(FontAwesome.QUESTION_CIRCLE);
    helpBtn.addStyleName(UIConstants.BUTTON_ACTION);
    helpBtn.setDescription(AppContext.getMessage(ProjectI18nEnum.OPT_MARK_TEMPLATE_HELP));
    gridFormLayoutHelper/*from   w  w  w.j ava 2 s  . c om*/
            .addComponent(
                    new MHorizontalLayout().withFullWidth().with(templateProjectComboBox, helpBtn)
                            .expand(templateProjectComboBox),
                    AppContext.getMessage(ProjectI18nEnum.FORM_TEMPLATE), 0, 0);
    final TextField prjNameField = new TextField();
    gridFormLayoutHelper.addComponent(prjNameField, AppContext.getMessage(GenericI18Enum.FORM_NAME), 0, 1);
    final TextField prjKeyField = new TextField();
    gridFormLayoutHelper.addComponent(prjKeyField, AppContext.getMessage(ProjectI18nEnum.FORM_SHORT_NAME), 0,
            2);
    MHorizontalLayout buttonControls = new MHorizontalLayout();
    content.with(gridFormLayoutHelper.getLayout(), buttonControls).withAlign(buttonControls,
            Alignment.MIDDLE_RIGHT);
    Button okBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_OK), new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            SimpleProject templatePrj = (SimpleProject) templateProjectComboBox.getValue();
            if (templatePrj == null) {
                NotificationUtil.showErrorNotification(
                        AppContext.getMessage(ProjectI18nEnum.ERROR_MUST_CHOOSE_TEMPLATE_PROJECT));
                return;
            }
            String newPrjName = prjNameField.getValue();
            if (newPrjName.length() == 0) {
                NotificationUtil.showErrorNotification("Project name must be not null");
                return;
            }
            String newPrjKey = prjKeyField.getValue();
            if (newPrjKey.length() > 3 || newPrjKey.length() == 0) {
                NotificationUtil
                        .showErrorNotification("Project key must be not null and less than 3 characters");
                return;
            }
            ProjectTemplateService projectTemplateService = AppContextUtil
                    .getSpringBean(ProjectTemplateService.class);
            if (projectTemplateService != null) {
                Integer newProjectId = projectTemplateService.cloneProject(templatePrj.getId(), newPrjName,
                        newPrjKey, AppContext.getAccountId(), AppContext.getUsername());
                EventBusFactory.getInstance().post(new ProjectEvent.GotoMyProject(this,
                        new PageActionChain(new ProjectScreenData.Goto(newProjectId))));
                close();
            }
        }
    });
    okBtn.setIcon(FontAwesome.SAVE);
    okBtn.addStyleName(UIConstants.BUTTON_ACTION);
    Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL),
            new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent clickEvent) {
                    close();
                }
            });
    cancelBtn.addStyleName(UIConstants.BUTTON_OPTION);
    buttonControls.with(cancelBtn, okBtn);
    this.setContent(content);
}

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

License:Open Source License

private ComponentContainer constructTableActionControls() {
    MHorizontalLayout layout = new MHorizontalLayout().withFullWidth();
    layout.addStyleName(UIConstants.TABLE_ACTION_CONTROLS);

    selectOptionButton = new SelectionOptionButton(tableItem);
    selectOptionButton.setWidthUndefined();
    layout.addComponent(selectOptionButton);

    tableActionControls = new DefaultMassItemActionHandlerContainer();

    tableActionControls.addDownloadPdfActionItem();
    tableActionControls.addDownloadExcelActionItem();
    tableActionControls.addDownloadCsvActionItem();

    tableActionControls.setVisible(false);
    tableActionControls.setWidthUndefined();

    layout.addComponent(tableActionControls);
    selectedItemsNumberLabel.setWidth("100%");
    layout.with(selectedItemsNumberLabel).withAlign(selectedItemsNumberLabel, Alignment.MIDDLE_CENTER)
            .expand(selectedItemsNumberLabel);

    Button customizeViewBtn = new Button("", new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override/*from   ww w . ja va  2 s .c  o m*/
        public void buttonClick(Button.ClickEvent event) {
            UI.getCurrent().addWindow(new ProjectListCustomizeWindow(tableItem));

        }
    });
    customizeViewBtn.setIcon(FontAwesome.ADJUST);
    customizeViewBtn.setDescription("Layout Options");
    customizeViewBtn.addStyleName(UIConstants.BUTTON_ACTION);
    layout.with(customizeViewBtn).withAlign(customizeViewBtn, Alignment.MIDDLE_RIGHT);

    return layout;
}

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

License:Open Source License

@Override
public void initView(final SimpleProject project) {
    this.removeAllComponents();
    updateVerticalTabsheetFixStatus();/*ww w .ja v  a  2 s.  c  om*/
    ControllerRegistry.addController(new ProjectController(this));
    this.setWidth("100%");

    this.addStyleName("main-content-wrapper");
    this.addStyleName("projectDashboardView");

    myProjectTab = new ProjectVerticalTabsheet();
    myProjectTab.setSizeFull();
    myProjectTab.setNavigatorWidth("100%");
    myProjectTab.setNavigatorStyleName("sidebar-menu");
    myProjectTab.setContainerStyleName("tab-content");

    myProjectTab.addSelectedTabChangeListener(new SelectedTabChangeListener() {

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            Tab tab = ((ProjectVerticalTabsheet) event.getSource()).getSelectedTab();
            String caption = ((TabImpl) tab).getTabId();
            if (ProjectTypeConstants.MESSAGE.equals(caption)) {
                messagePresenter.go(ProjectViewImpl.this, null);
            } else if (ProjectTypeConstants.MILESTONE.equals(caption)) {
                MilestoneSearchCriteria searchCriteria = new MilestoneSearchCriteria();
                searchCriteria.setProjectId(
                        new NumberSearchField(SearchField.AND, CurrentProjectVariables.getProjectId()));
                gotoMilestoneView(new MilestoneScreenData.Search(searchCriteria));
            } else if (ProjectTypeConstants.TASK.equals(caption)) {
                taskPresenter.go(ProjectViewImpl.this, null);
            } else if (ProjectTypeConstants.BUG.equals(caption)) {
                gotoBugView(null);
            } else if (ProjectTypeConstants.RISK.equals(caption)) {
                RiskSearchCriteria searchCriteria = new RiskSearchCriteria();
                searchCriteria.setProjectId(
                        new NumberSearchField(SearchField.AND, CurrentProjectVariables.getProjectId()));
                gotoRiskView(new RiskScreenData.Search(searchCriteria));
            } else if (ProjectTypeConstants.FILE.equals(caption)) {
                filePresenter.go(ProjectViewImpl.this, new FileScreenData.GotoDashboard());
            } else if (ProjectTypeConstants.PAGE.equals(caption)) {
                pagePresenter.go(ProjectViewImpl.this,
                        new PageScreenData.Search(CurrentProjectVariables.getBasePagePath()));
            } else if (ProjectTypeConstants.PROBLEM.equals(caption)) {
                ProblemSearchCriteria searchCriteria = new ProblemSearchCriteria();
                searchCriteria.setProjectId(
                        new NumberSearchField(SearchField.AND, CurrentProjectVariables.getProjectId()));
                problemPresenter.go(ProjectViewImpl.this, new ProblemScreenData.Search(searchCriteria));
            } else if (ProjectTypeConstants.DASHBOARD.equals(caption)) {
                dashboardPresenter.go(ProjectViewImpl.this, null);
            } else if (ProjectTypeConstants.MEMBER.equals(caption)) {
                ProjectMemberSearchCriteria criteria = new ProjectMemberSearchCriteria();
                criteria.setProjectId(new NumberSearchField(CurrentProjectVariables.getProjectId()));
                criteria.setStatus(new StringSearchField(ProjectMemberStatusConstants.ACTIVE));
                gotoUsersAndGroup(new ProjectMemberScreenData.Search(criteria));
            } else if (ProjectTypeConstants.TIME.equals(caption)) {
                ItemTimeLoggingSearchCriteria searchCriteria = new ItemTimeLoggingSearchCriteria();
                searchCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
                searchCriteria
                        .setRangeDate(ItemTimeLoggingSearchCriteria.getCurrentRangeDateOfWeekSearchField());
                gotoTimeTrackingView(new TimeTrackingScreenData.Search(searchCriteria));
            } else if (ProjectTypeConstants.STANDUP.equals(caption)) {
                StandupReportSearchCriteria criteria = new StandupReportSearchCriteria();
                criteria.setProjectId(new NumberSearchField(CurrentProjectVariables.getProjectId()));
                criteria.setOnDate(new DateSearchField(SearchField.AND, DateSearchField.EQUAL,
                        new GregorianCalendar().getTime()));
                standupPresenter.go(ProjectViewImpl.this, new StandupScreenData.Search(criteria));
            }

        }
    });

    VerticalLayout contentWrapper = myProjectTab.getContentWrapper();
    contentWrapper.addStyleName("main-content");
    MHorizontalLayout topPanel = new MHorizontalLayout().withSpacing(false).withMargin(true).withWidth("100%")
            .withStyleName("top-panel");
    contentWrapper.addComponentAsFirst(topPanel);

    ProjectListComponent prjList = new ProjectListComponent();
    CssLayout navigatorWrapper = myProjectTab.getNavigatorWrapper();
    navigatorWrapper.addComponentAsFirst(prjList);
    navigatorWrapper.setWidth("250px");

    buildComponents();
    this.addComponent(myProjectTab);

    ProjectBreadcrumb breadCrumb = ViewManager.getCacheComponent(ProjectBreadcrumb.class);
    breadCrumb.setProject(project);

    topPanel.with(breadCrumb).withAlign(breadCrumb, Alignment.MIDDLE_LEFT).expand(breadCrumb);

    if (project.isProjectArchived()) {
        Button activeProjectBtn = new Button(AppContext.getMessage(ProjectCommonI18nEnum.BUTTON_ACTIVE_PROJECT),
                new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        ProjectService projectService = ApplicationContextUtil
                                .getSpringBean(ProjectService.class);
                        project.setProjectstatus(StatusI18nEnum.Open.name());
                        projectService.updateSelectiveWithSession(project, AppContext.getUsername());

                        PageActionChain chain = new PageActionChain(
                                new ProjectScreenData.Goto(CurrentProjectVariables.getProjectId()));
                        EventBusFactory.getInstance().post(new ProjectEvent.GotoMyProject(this, chain));

                    }
                });
        activeProjectBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
        topPanel.with(activeProjectBtn).withAlign(activeProjectBtn, Alignment.MIDDLE_RIGHT);
    } else {
        final PopupButton controlsBtn = new PopupButton();
        controlsBtn.setIcon(FontAwesome.ELLIPSIS_H);
        controlsBtn.addStyleName(UIConstants.THEME_BLANK_LINK);

        VerticalLayout popupButtonsControl = new VerticalLayout();
        popupButtonsControl.setSpacing(true);
        popupButtonsControl.setWidth("150px");

        Button createPhaseBtn = new Button(AppContext.getMessage(MilestoneI18nEnum.BUTTON_NEW_PHASE),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        EventBusFactory.getInstance()
                                .post(new MilestoneEvent.GotoAdd(ProjectViewImpl.this, null));
                    }
                });
        createPhaseBtn
                .setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES));
        createPhaseBtn.setIcon(ProjectAssetsManager.getAsset(ProjectTypeConstants.MILESTONE));
        createPhaseBtn.setStyleName("link");
        popupButtonsControl.addComponent(createPhaseBtn);

        Button createTaskBtn = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASK),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        EventBusFactory.getInstance().post(new TaskEvent.GotoAdd(ProjectViewImpl.this, null));
                    }
                });
        createTaskBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS));
        createTaskBtn.setIcon(ProjectAssetsManager.getAsset(ProjectTypeConstants.TASK));
        createTaskBtn.setStyleName("link");
        popupButtonsControl.addComponent(createTaskBtn);

        Button createBugBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_BUG),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        EventBusFactory.getInstance().post(new BugEvent.GotoAdd(this, null));
                    }
                });
        createBugBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.BUGS));
        createBugBtn.setIcon(ProjectAssetsManager.getAsset(ProjectTypeConstants.BUG));
        createBugBtn.setStyleName("link");
        popupButtonsControl.addComponent(createBugBtn);

        Button createRiskBtn = new Button(AppContext.getMessage(RiskI18nEnum.BUTTON_NEW_RISK),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        EventBusFactory.getInstance().post(new RiskEvent.GotoAdd(this, null));
                    }
                });
        createRiskBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.RISKS));
        createRiskBtn.setIcon(ProjectAssetsManager.getAsset(ProjectTypeConstants.RISK));
        createRiskBtn.setStyleName("link");
        popupButtonsControl.addComponent(createRiskBtn);

        Button createProblemBtn = new Button(AppContext.getMessage(ProblemI18nEnum.BUTTON_NEW_PROBLEM),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        EventBusFactory.getInstance().post(new ProblemEvent.GotoAdd(this, null));
                    }
                });
        createProblemBtn
                .setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PROBLEMS));
        createProblemBtn.setIcon(ProjectAssetsManager.getAsset(ProjectTypeConstants.PROBLEM));
        createProblemBtn.setStyleName("link");
        popupButtonsControl.addComponent(createProblemBtn);

        Button editProjectBtn = new Button(AppContext.getMessage(ProjectCommonI18nEnum.BUTTON_EDIT_PROJECT),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        dashboardPresenter.go(ProjectViewImpl.this, new ProjectScreenData.Edit(project));
                    }
                });
        editProjectBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PROJECT));
        editProjectBtn.setIcon(FontAwesome.EDIT);
        editProjectBtn.setStyleName("link");
        popupButtonsControl.addComponent(editProjectBtn);

        Button archieveProjectBtn = new Button(
                AppContext.getMessage(ProjectCommonI18nEnum.BUTTON_ARCHIVE_PROJECT),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        controlsBtn.setPopupVisible(false);
                        ConfirmDialogExt.show(UI.getCurrent(),
                                AppContext.getMessage(GenericI18Enum.WINDOW_WARNING_TITLE,
                                        SiteConfiguration.getSiteName()),
                                AppContext.getMessage(
                                        ProjectCommonI18nEnum.DIALOG_CONFIRM_PROJECT_ARCHIVE_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()) {
                                            ProjectService projectService = ApplicationContextUtil
                                                    .getSpringBean(ProjectService.class);
                                            project.setProjectstatus(StatusI18nEnum.Archived.name());
                                            projectService.updateSelectiveWithSession(project,
                                                    AppContext.getUsername());

                                            PageActionChain chain = new PageActionChain(
                                                    new ProjectScreenData.Goto(
                                                            CurrentProjectVariables.getProjectId()));
                                            EventBusFactory.getInstance()
                                                    .post(new ProjectEvent.GotoMyProject(this, chain));
                                        }
                                    }
                                });
                    }
                });
        archieveProjectBtn
                .setEnabled(CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.PROJECT));
        archieveProjectBtn.setIcon(FontAwesome.ARCHIVE);
        archieveProjectBtn.setStyleName("link");
        popupButtonsControl.addComponent(archieveProjectBtn);

        if (CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.PROJECT)) {
            Button deleteProjectBtn = new Button(
                    AppContext.getMessage(ProjectCommonI18nEnum.BUTTON_DELETE_PROJECT),
                    new Button.ClickListener() {
                        @Override
                        public void buttonClick(ClickEvent event) {
                            controlsBtn.setPopupVisible(false);
                            ConfirmDialogExt.show(UI.getCurrent(),
                                    AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE,
                                            SiteConfiguration.getSiteName()),
                                    AppContext.getMessage(
                                            ProjectCommonI18nEnum.DIALOG_CONFIRM_PROJECT_DELETE_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()) {
                                                ProjectService projectService = ApplicationContextUtil
                                                        .getSpringBean(ProjectService.class);
                                                projectService.removeWithSession(
                                                        CurrentProjectVariables.getProjectId(),
                                                        AppContext.getUsername(), AppContext.getAccountId());
                                                EventBusFactory.getInstance()
                                                        .post(new ShellEvent.GotoProjectModule(this, null));
                                            }
                                        }
                                    });
                        }
                    });
            deleteProjectBtn
                    .setEnabled(CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.PROJECT));
            deleteProjectBtn.setIcon(FontAwesome.TRASH_O);
            deleteProjectBtn.setStyleName("link");
            popupButtonsControl.addComponent(deleteProjectBtn);
        }

        controlsBtn.setContent(popupButtonsControl);
        controlsBtn.setWidthUndefined();

        topPanel.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
    }

    prjList.showProjects();
}