Exemplo 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;
  }
Exemplo n.º 2
0
 /**
  * Method used to create cell placeholder. To be overridden if simple reflections with default
  * constructors are not enough.
  *
  * @param column Column index
  * @param cell Cell index
  * @return New instance of placeholder
  */
 protected Component createPlaceholder(int column, int cell) {
   Component placeHolder;
   try {
     placeHolder = placeholderClass.newInstance();
   } catch (Exception e) {
     throw new IllegalStateException("Failed to initialize placeholder class instance", e);
   }
   placeHolder.addStyleName("placeholder");
   placeHolder.addStyleName("placeholder-" + column + "-" + cell);
   return placeHolder;
 }
Exemplo n.º 3
0
 private Component buildNotes() {
   TextArea notes = new TextArea("Notes");
   notes.setValue(
       "Remember to:\n· Zoom in and out in the Sales view\n· Filter the transactions and drag a set of them to the Reports tab\n· Create a new report\n· Change the schedule of the movie theater");
   notes.setSizeFull();
   notes.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
   Component panel = createContentWrapper(notes);
   panel.addStyleName("notes");
   return panel;
 }
Exemplo n.º 4
0
 public Component selectTab(String viewId) {
   Tab tab = compMap.get(viewId);
   Button btn = getButtonById(viewId);
   if (btn != null) {
     selectedButton = btn;
     clearTabSelection(true);
     selectedButton.addStyleName(TAB_SELECTED_STYLENAME);
     setDefaulButtonIcon(selectedButton, true);
     selectedComp = tab;
     tabContainer.removeAllComponents();
     tabContainer.addComponent(tab.getComponent());
     return tab.getComponent();
   } else {
     return null;
   }
 }
Exemplo n.º 5
0
  private void toggleMaximized(final Component panel, final boolean maximized) {
    for (Iterator<Component> it = root.iterator(); it.hasNext(); ) {
      it.next().setVisible(!maximized);
    }
    dashboardPanels.setVisible(true);

    for (Iterator<Component> it = dashboardPanels.iterator(); it.hasNext(); ) {
      Component c = it.next();
      c.setVisible(!maximized);
    }

    if (maximized) {
      panel.setVisible(true);
      panel.addStyleName("max");
    } else {
      panel.removeStyleName("max");
    }
  }
Exemplo n.º 6
0
 private Component buildTop10TitlesByRevenue() {
   Component contentWrapper = createContentWrapper(new TopTenMoviesTable());
   contentWrapper.addStyleName("top10-revenue");
   return contentWrapper;
 }