Esempio n. 1
0
  @Override
  public Component getContent(Project project, ExtensionUtil util) {
    Layout layout = new CssLayout();
    layout.addStyleName(STYLE_TEAM_INFOBOX);
    layout.setSizeFull();
    PeopleExtension ext = project.getExtension(PeopleExtension.class);
    if (ext != null) {
      if (ext.getLeads().size() > 0) {
        Label projectLeadHeaderLabel = new Label("Project Lead");
        projectLeadHeaderLabel.addStyleName(STYLE_TEAMLABEL);
        layout.addComponent(projectLeadHeaderLabel);
        Component peopleComponent = PeopleComponent.getPeopleListComponentForMember(ext.getLeads());
        peopleComponent.addStyleName(InformationBox.STYLE);
        layout.addComponent(peopleComponent);
      }

      if (ext.getMembers().size() > 0) {
        Label projectTeamHeaderLabel = new Label("Project Team/Committers");
        projectTeamHeaderLabel.addStyleName(STYLE_TEAMLABEL);
        layout.addComponent(projectTeamHeaderLabel);

        Component peopleComponent =
            PeopleComponent.getPeopleListComponentForMember(ext.getMembers());
        peopleComponent.addStyleName(InformationBox.STYLE);
        layout.addComponent(peopleComponent);
      }

      String mailToTeamHtml = new MailToTeam(ext).composeMailToTeamLabel();
      createLabel(layout, mailToTeamHtml);
    }
    return layout;
  }
Esempio n. 2
0
 @Override
 public boolean isVisible(Project project, String loggedInUserId) {
   PeopleExtension ext = project.getExtension(PeopleExtension.class);
   if (ext == null || ext.getMembers().isEmpty() && ext.getLeads().isEmpty()) {
     return false;
   } else {
     return true;
   }
 }