@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; }
/** * 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; }
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; }
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; } }
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"); } }
private Component buildTop10TitlesByRevenue() { Component contentWrapper = createContentWrapper(new TopTenMoviesTable()); contentWrapper.addStyleName("top10-revenue"); return contentWrapper; }