List of usage examples for com.vaadin.ui HorizontalLayout setHeight
@Override public void setHeight(String height)
From source file:com.cerebro.provevaadin.SignIn.java
private VerticalLayout setSecondStep() { VerticalLayout secondStep = new VerticalLayout(); CssLayout header = new CssLayout(); Label title = new Label("Benvenuto " + u.getNomeUtente() + "!"); Label istructions = new Label("Crea il tuo personaggio"); Label step = new Label("2/*"); header.addComponents(title, istructions, step); VerticalLayout body = new VerticalLayout(); Label ageIstruction = new Label("Indica l'et del tuo personaggio in anni"); // Cambiare i parametri in base alla razza Slider age = new Slider(1, 150); age.setImmediate(true);/*from w w w.j a va 2s . c om*/ age.setSizeFull(); HorizontalLayout ageDescription = new HorizontalLayout(); ageDescription.setHeight("250px"); Label ageText = new Label("Valore dell'et: "); Label ageValue = new Label(age.getValue().toString()); Label periodoVita = new Label(""); ageDescription.addComponents(ageText, ageValue, periodoVita); age.addValueChangeListener((Property.ValueChangeEvent event) -> { System.out.println("Valore: " + age.getValue().toString()); ageValue.setValue(age.getValue().toString()); Double value = (100 * (age.getValue()) / (age.getMax())); if (value < 14) { periodoVita.setValue("Bambino"); } else if (value > 14 && value < 24) { periodoVita.setValue("Adolescenza"); } else if (value > 24 && value < 73) { periodoVita.setValue("Et adulta"); } else if (value > 73) { periodoVita.setValue("Et anziana"); } }); body.addComponents(ageIstruction, age, ageDescription); CssLayout footer = new CssLayout(); Button next = new Button("Avanti ->"); next.addClickListener((Button.ClickEvent event) -> { u.setEtaPG(age.getValue().toString()); this.setContent(setThirdStep()); }); footer.addComponents(next, createCancelButton()); secondStep.addComponents(header, body, footer); return secondStep; }
From source file:com.cerebro.provevaadin.Start.java
public Start() { InputStream iniFile = VaadinServlet.getCurrent().getServletContext() .getResourceAsStream("/WEB-INF/shiro.ini"); if (iniFile == null) { logger.error("Il file Shiro.ini non esiste"); return;//w ww . j ava2 s .c o m } else { logger.info("File presente"); } Ini ini = new Ini(); ini.load(iniFile); Factory<SecurityManager> factory = new IniSecurityManagerFactory(ini); SecurityManager securityManager = factory.getInstance(); SecurityUtils.setSecurityManager(securityManager); HorizontalLayout root = new HorizontalLayout(); root.setWidth("800px"); root.setHeight("600px"); this.addComponent(root); this.setComponentAlignment(root, Alignment.MIDDLE_CENTER); FormLayout loginDiv = new FormLayout(); root.addComponent(loginDiv); username.focus(); errorMessage.setVisible(false); loginDiv.addComponents(username, password, rememberMe, login, errorMessage); login.addClickListener((Button.ClickEvent e) -> { logger.info("Pulsante: " + e.toString()); Subject currentUser = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username.getValue(), password.getValue()); token.setRememberMe(rememberMe.getValue()); try { currentUser.login(token); if (currentUser.hasRole("firsttime")) { logger.info("Configurazione parametri del primo avvio"); getUI().setContent(new FirstTime()); } else { logger.info("Classe di gioco principale"); getUI().setContent(new Game()); VaadinService.reinitializeSession(VaadinService.getCurrentRequest()); } } catch (Exception ex) { logger.error("Errore nel login: " + ex.getMessage()); username.setValue(""); password.setValue(""); errorMessage.setVisible(true); } }); FormLayout signInForm = new FormLayout(); root.addComponent(signInForm); usernameSignIn.focus(); sesso.addItems("Maschio", "Femmina"); signInForm.addComponents(usernameSignIn, passwordSignIn, passwordConf, nome, cognome, sesso, eta, signIn); signIn.addClickListener((Button.ClickEvent event) -> { logger.info("Iscrizione al sito"); User utente = new User(); utente.setEmail(usernameSignIn.getValue()); utente.setPassword(passwordSignIn.getValue()); utente.setNomeUtente(nome.getValue()); utente.setCognomeUtente(cognome.getValue()); utente.setSessoUtente(sesso.getValue().toString()); utente.setDataNascitaUtente(eta.getValue()); SignIn signInWindow = new SignIn(utente); signInWindow.center(); UI.getCurrent().addWindow(signInWindow); }); }
From source file:com.cms.component.WindowProgress.java
public WindowProgress(String caption) { setClosable(false);//from ww w . j ava 2 s . c o m setReadOnly(true); setResizable(false); setWidth("-1px"); setHeight("-1px"); setModal(true); // setStyleName("loading-window"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setWidth("-1px"); horizontalLayout.setHeight("-1px"); horizontalLayout.setSpacing(true); horizontalLayout.setMargin(true); pb = new ProgressBar(); pb.setIndeterminate(true); lb = new Label(); lb.setValue(BundleUtils.getString("Running")); horizontalLayout.addComponent(pb); horizontalLayout.addComponent(lb); setContent(horizontalLayout); }
From source file:com.cms.component.WindowProgress.java
public WindowProgress() { setClosable(false);//from w w w . jav a 2 s.co m setReadOnly(true); setResizable(false); setWidth("-1px"); setHeight("-1px"); setModal(true); // setStyleName("loading-window"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setWidth("-1px"); horizontalLayout.setHeight("-1px"); horizontalLayout.setSpacing(true); horizontalLayout.setMargin(true); pb = new ProgressBar(); pb.setIndeterminate(true); lb = new Label(); lb.setValue(BundleUtils.getString("Running")); horizontalLayout.addComponent(pb); horizontalLayout.addComponent(lb); setContent(horizontalLayout); }
From source file:com.emuanalytics.vaadin.enhancedjavascript.BasicTestUI.java
License:Apache License
@Override public Component getTestComponent() { // The sample component under test sampleComponent = new SampleEnhancedComponent(); sampleComponent.setId("sample-component"); Component componentWrapper = createComponentContainer(sampleComponent); Component testPanel = createTestPanel(); HorizontalLayout layout = new HorizontalLayout(componentWrapper, testPanel); layout.setWidth("100%"); layout.setHeight("100%"); layout.setMargin(true);//from w w w . java2 s .com layout.setExpandRatio(componentWrapper, 1); sampleComponent.addClickListener(value -> { lastEventField.setValue("Click (value=" + value + ")"); }); sampleComponent.addVariableChangeListener(value -> { lastVariableChangeField.setValue("inputValue Changed (value=" + value.toString() + ")"); }); return layout; }
From source file:com.esofthead.mycollab.mobile.ui.GridFormLayoutHelper.java
License:Open Source License
public Component addComponent(final Component field, final String caption, final int columns, final int rows, final int colspan, final String width, final Alignment alignment) { if (caption != null) { final Label l = new Label(caption); final HorizontalLayout captionWrapper = new HorizontalLayout(); captionWrapper.addComponent(l);/*from w w w .java 2 s . co m*/ captionWrapper.setComponentAlignment(l, alignment); captionWrapper.setStyleName("gridform-caption"); captionWrapper.setMargin(true); captionWrapper.setWidth(this.defaultCaptionWidth); if (columns == 0) { captionWrapper.addStyleName("first-col"); } if (rows == 0) { captionWrapper.addStyleName("first-row"); } if ((rows + 1) % 2 == 0) captionWrapper.addStyleName("even-row"); this.layout.addComponent(captionWrapper, 2 * columns, rows); captionWrapper.setHeight("100%"); } final HorizontalLayout fieldWrapper = new HorizontalLayout(); fieldWrapper.setStyleName("gridform-field"); fieldWrapper.setMargin(true); fieldWrapper.addComponent(field); if (!(field instanceof Button)) field.setCaption(null); field.setWidth(width); fieldWrapper.setWidth("100%"); if (rows == 0) { fieldWrapper.addStyleName("first-row"); } if ((rows + 1) % 2 == 0) { fieldWrapper.addStyleName("even-row"); } this.layout.addComponent(fieldWrapper, 2 * columns + 1, rows, 2 * (columns + colspan - 1) + 1, rows); this.layout.setColumnExpandRatio(2 * columns + 1, 1.0f); return field; }
From source file:com.esofthead.mycollab.mobile.ui.GridFormLayoutHelper.java
License:Open Source License
public Component addComponent(final Component field, final String caption, final int columns, final int rows, final String width, final Alignment alignment) { if (caption != null) { final Label l = new Label(caption); // l.setHeight("100%"); final HorizontalLayout captionWrapper = new HorizontalLayout(); captionWrapper.addComponent(l);/*w ww . j a v a2s .c om*/ captionWrapper.setComponentAlignment(l, alignment); captionWrapper.setWidth(this.defaultCaptionWidth); captionWrapper.setHeight("100%"); captionWrapper.setStyleName("gridform-caption"); captionWrapper.setMargin(true); if (columns == 0) { captionWrapper.addStyleName("first-col"); } if (rows == 0) { captionWrapper.addStyleName("first-row"); } this.layout.addComponent(captionWrapper, 2 * columns, rows); } final HorizontalLayout fieldWrapper = new HorizontalLayout(); fieldWrapper.setStyleName("gridform-field"); if (!(field instanceof Button)) field.setCaption(null); fieldWrapper.addComponent(field); field.setWidth(width); fieldWrapper.setWidth("100%"); fieldWrapper.setMargin(true); if (rows == 0) { fieldWrapper.addStyleName("first-row"); } this.layout.addComponent(fieldWrapper, 2 * columns + 1, rows); this.layout.setColumnExpandRatio(2 * columns + 1, 1.0f); return field; }
From source file:com.esofthead.mycollab.mobile.ui.GridFormLayoutHelper.java
License:Open Source License
public Component addComponent(Component fieldValue, Component fieldCaption, String defaultCaptionWidth, String fieldValueWidth, int columns, int rows, Alignment alignment) { final HorizontalLayout captionWrapper = new HorizontalLayout(); captionWrapper.addComponent(fieldCaption); captionWrapper.setComponentAlignment(fieldCaption, alignment); captionWrapper.setWidth(defaultCaptionWidth); captionWrapper.setHeight("100%"); captionWrapper.setMargin(true);/*from w w w . ja va 2s . c o m*/ captionWrapper.setStyleName("gridform-caption"); if (columns == 0) { captionWrapper.addStyleName("first-col"); } if (rows == 0) { captionWrapper.addStyleName("first-row"); } this.layout.addComponent(captionWrapper, 2 * columns, rows); final HorizontalLayout fieldWrapper = new HorizontalLayout(); fieldWrapper.setStyleName("gridform-field"); if (!(fieldValue instanceof Button)) fieldValue.setCaption(null); fieldWrapper.addComponent(fieldValue); fieldValue.setWidth(fieldValueWidth); fieldWrapper.setWidth("100%"); fieldWrapper.setMargin(true); if (rows == 0) { fieldWrapper.addStyleName("first-row"); } this.layout.addComponent(fieldWrapper, 2 * columns + 1, rows); this.layout.setColumnExpandRatio(2 * columns + 1, 1.0f); return fieldValue; }
From source file:com.esofthead.mycollab.module.crm.view.activity.ActivityCalendarViewImpl.java
License:Open Source License
private void initContent() { MHorizontalLayout contentWrapper = new MHorizontalLayout().withSpacing(false).withWidth("100%"); this.addComponent(contentWrapper); /* Content cheat */ MVerticalLayout mainContent = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true)) .withWidth("100%").withStyleName("readview-layout"); contentWrapper.with(mainContent).expand(mainContent); MVerticalLayout rightColumn = new MVerticalLayout().withMargin(new MarginInfo(true, false, true, false)) .withWidth("250px"); rightColumn.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); contentWrapper.addComponent(rightColumn); MHorizontalLayout actionPanel = new MHorizontalLayout().withMargin(new MarginInfo(true, false, true, false)) .withWidth("100%").withStyleName(UIConstants.HEADER_VIEW); actionPanel.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); Label headerText = new CrmViewHeader(CrmTypeConstants.ACTIVITY, "Calendar"); headerText.setStyleName(UIConstants.HEADER_TEXT); actionPanel.with(headerText).expand(headerText); mainContent.addComponent(actionPanel); this.dateHdr = new Label(); this.dateHdr.setSizeUndefined(); this.dateHdr.setStyleName("h2"); mainContent.addComponent(this.dateHdr); mainContent.setComponentAlignment(this.dateHdr, Alignment.MIDDLE_CENTER); toggleViewBtn = new PopupButton("Monthly"); toggleViewBtn.setWidth("200px"); toggleViewBtn.addStyleName("calendar-view-switcher"); MVerticalLayout popupLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, false, true)) .withWidth("190px"); monthViewBtn = new Button("Monthly", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override// w w w . ja v a2s . c om public void buttonClick(ClickEvent event) { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(monthViewBtn.getCaption()); calendarComponent.switchToMonthView(new Date(), true); datePicker.selectDate(new Date()); monthViewBtn.addStyleName("selected-style"); initLabelCaption(); } }); monthViewBtn.setStyleName("link"); popupLayout.addComponent(monthViewBtn); weekViewBtn = new Button("Weekly", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(weekViewBtn.getCaption()); calendarComponent.switchToWeekView(new Date()); datePicker.selectWeek(new Date()); } }); weekViewBtn.setStyleName("link"); popupLayout.addComponent(weekViewBtn); dailyViewBtn = new Button("Daily", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(dailyViewBtn.getCaption()); Date currentDate = new Date(); datePicker.selectDate(currentDate); calendarComponent.switchToDateView(currentDate); } }); dailyViewBtn.setStyleName("link"); popupLayout.addComponent(dailyViewBtn); toggleViewBtn.setContent(popupLayout); CssLayout toggleBtnWrap = new CssLayout(); toggleBtnWrap.setStyleName("switcher-wrap"); toggleBtnWrap.addComponent(toggleViewBtn); rightColumn.addComponent(toggleBtnWrap); rightColumn.setComponentAlignment(toggleBtnWrap, Alignment.MIDDLE_CENTER); rightColumn.addComponent(this.datePicker); initLabelCaption(); addCalendarEvent(); actionPanel.addComponent(calendarActionBtn); actionPanel.setComponentAlignment(calendarActionBtn, Alignment.MIDDLE_RIGHT); VerticalLayout actionBtnLayout = new VerticalLayout(); actionBtnLayout.setMargin(true); actionBtnLayout.setSpacing(true); actionBtnLayout.setWidth("150px"); Button.ClickListener listener = new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { calendarActionBtn.setPopupVisible(false); String caption = event.getButton().getCaption(); if (caption.equals("New Task")) { EventBusFactory.getInstance().post(new ActivityEvent.TaskAdd(this, null)); } else if (caption.equals("New Call")) { EventBusFactory.getInstance().post(new ActivityEvent.CallAdd(this, null)); } else if (caption.equals("New Event")) { EventBusFactory.getInstance().post(new ActivityEvent.MeetingAdd(this, null)); } } }; ButtonLink todoBtn = new ButtonLink("New Task", listener); actionBtnLayout.addComponent(todoBtn); todoBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.TASK)); todoBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_TASK)); Button callBtn = new ButtonLink("New Call", listener); actionBtnLayout.addComponent(callBtn); callBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CALL)); callBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CALL)); ButtonLink meetingBtn = new ButtonLink("New Meeting", listener); actionBtnLayout.addComponent(meetingBtn); meetingBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.MEETING)); meetingBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_MEETING)); calendarActionBtn.setContent(actionBtnLayout); ButtonGroup viewSwitcher = new ButtonGroup(); Button calendarViewBtn = new Button("Calendar"); calendarViewBtn.setStyleName("selected"); calendarViewBtn.addStyleName(UIConstants.THEME_GREEN_LINK); viewSwitcher.addButton(calendarViewBtn); Button activityListBtn = new Button("Activities", new Button.ClickListener() { private static final long serialVersionUID = 2156576556541398934L; @Override public void buttonClick(ClickEvent evt) { ActivitySearchCriteria criteria = new ActivitySearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); EventBusFactory.getInstance().post(new ActivityEvent.GotoTodoList(this, null)); } }); activityListBtn.addStyleName(UIConstants.THEME_GREEN_LINK); viewSwitcher.addButton(activityListBtn); actionPanel.addComponent(viewSwitcher); actionPanel.setComponentAlignment(viewSwitcher, Alignment.MIDDLE_RIGHT); calendarComponent = new CalendarDisplay(); mainContent.addComponent(calendarComponent); mainContent.setExpandRatio(calendarComponent, 1); mainContent.setComponentAlignment(calendarComponent, Alignment.MIDDLE_CENTER); HorizontalLayout spacing = new HorizontalLayout(); spacing.setHeight("30px"); mainContent.addComponent(spacing); HorizontalLayout noteInfoLayout = new HorizontalLayout(); noteInfoLayout.setSpacing(true); HorizontalLayout noteWapper = new HorizontalLayout(); noteWapper.setHeight("30px"); Label noteLbl = new Label("Note:"); noteWapper.addComponent(noteLbl); noteWapper.setComponentAlignment(noteLbl, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(noteWapper); HorizontalLayout completeWapper = new HorizontalLayout(); completeWapper.setWidth("100px"); completeWapper.setHeight("30px"); completeWapper.addStyleName("eventLblcompleted"); Label completeLabel = new Label("Completed"); completeWapper.addComponent(completeLabel); completeWapper.setComponentAlignment(completeLabel, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(completeWapper); HorizontalLayout overdueWapper = new HorizontalLayout(); overdueWapper.setWidth("100px"); overdueWapper.setHeight("30px"); overdueWapper.addStyleName("eventLbloverdue"); Label overdueLabel = new Label("Overdue"); overdueWapper.addComponent(overdueLabel); overdueWapper.setComponentAlignment(overdueLabel, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(overdueWapper); HorizontalLayout futureWapper = new HorizontalLayout(); futureWapper.setWidth("100px"); futureWapper.setHeight("30px"); futureWapper.addStyleName("eventLblfuture"); Label futureLabel = new Label("Future"); futureWapper.addComponent(futureLabel); futureWapper.setComponentAlignment(futureLabel, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(futureWapper); mainContent.addComponent(noteInfoLayout); mainContent.setComponentAlignment(noteInfoLayout, Alignment.MIDDLE_CENTER); }
From source file:com.esofthead.mycollab.module.project.view.TimeTrackingSummaryViewImpl.java
License:Open Source License
@Override public void display() { projects = ApplicationContextUtil.getSpringBean(ProjectService.class) .getProjectsUserInvolved(AppContext.getUsername(), AppContext.getAccountId()); if (CollectionUtils.isNotEmpty(projects)) { itemTimeLoggingService = ApplicationContextUtil.getSpringBean(ItemTimeLoggingService.class); final CssLayout headerWrapper = new CssLayout(); headerWrapper.setWidth("100%"); headerWrapper.setStyleName("projectfeed-hdr-wrapper"); HorizontalLayout loggingPanel = new HorizontalLayout(); HorizontalLayout controlBtns = new HorizontalLayout(); controlBtns.setMargin(new MarginInfo(true, false, true, false)); final Label layoutHeader = new Label( ProjectAssetsManager.getAsset(ProjectTypeConstants.TIME).getHtml() + " Time Tracking", ContentMode.HTML); layoutHeader.addStyleName("h2"); final MHorizontalLayout header = new MHorizontalLayout().withWidth("100%"); header.with(layoutHeader).withAlign(layoutHeader, Alignment.MIDDLE_LEFT).expand(layoutHeader); final CssLayout contentWrapper = new CssLayout(); contentWrapper.setWidth("100%"); contentWrapper.addStyleName(UIConstants.CONTENT_WRAPPER); headerWrapper.addComponent(header); this.addComponent(headerWrapper); contentWrapper.addComponent(controlBtns); MHorizontalLayout controlsPanel = new MHorizontalLayout().withWidth("100%"); contentWrapper.addComponent(controlsPanel); contentWrapper.addComponent(loggingPanel); this.addComponent(contentWrapper); final Button backBtn = new Button("Back to Workboard"); backBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override/*from www . j a v a 2 s.c om*/ public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance() .post(new ShellEvent.GotoProjectModule(TimeTrackingSummaryViewImpl.this, null)); } }); backBtn.addStyleName(UIConstants.THEME_GREEN_LINK); backBtn.setIcon(FontAwesome.ARROW_LEFT); controlBtns.addComponent(backBtn); VerticalLayout selectionLayoutWrapper = new VerticalLayout(); selectionLayoutWrapper.setWidth("100%"); selectionLayoutWrapper.addStyleName("time-tracking-summary-search-panel"); controlsPanel.addComponent(selectionLayoutWrapper); final GridLayout selectionLayout = new GridLayout(9, 2); selectionLayout.setSpacing(true); selectionLayout.setDefaultComponentAlignment(Alignment.TOP_RIGHT); selectionLayout.setMargin(true); selectionLayoutWrapper.addComponent(selectionLayout); Label fromLb = new Label("From:"); fromLb.setWidthUndefined(); selectionLayout.addComponent(fromLb, 0, 0); this.fromDateField = new PopupDateFieldExt(); this.fromDateField.setResolution(Resolution.DAY); this.fromDateField.setDateFormat(AppContext.getUserDateFormat()); this.fromDateField.setWidth("100px"); selectionLayout.addComponent(this.fromDateField, 1, 0); Label toLb = new Label("To:"); toLb.setWidthUndefined(); selectionLayout.addComponent(toLb, 2, 0); this.toDateField = new PopupDateFieldExt(); this.toDateField.setResolution(Resolution.DAY); this.toDateField.setDateFormat(AppContext.getUserDateFormat()); this.toDateField.setWidth("100px"); selectionLayout.addComponent(this.toDateField, 3, 0); Label groupLb = new Label("Group:"); groupLb.setWidthUndefined(); selectionLayout.addComponent(groupLb, 0, 1); this.groupField = new ValueComboBox(false, GROUPBY_PROJECT, GROUPBY_DATE, GROUPBY_USER); this.groupField.setWidth("100px"); selectionLayout.addComponent(this.groupField, 1, 1); Label sortLb = new Label("Sort:"); sortLb.setWidthUndefined(); selectionLayout.addComponent(sortLb, 2, 1); this.orderField = new ItemOrderComboBox(); this.orderField.setWidth("100px"); selectionLayout.addComponent(this.orderField, 3, 1); Label projectLb = new Label("Project:"); projectLb.setWidthUndefined(); selectionLayout.addComponent(projectLb, 4, 0); this.projectField = new UserInvolvedProjectsListSelect(); initListSelectStyle(this.projectField); selectionLayout.addComponent(this.projectField, 5, 0, 5, 1); Label userLb = new Label("User:"); userLb.setWidthUndefined(); selectionLayout.addComponent(userLb, 6, 0); this.userField = new UserInvolvedProjectsMemberListSelect(getProjectIds()); initListSelectStyle(this.userField); selectionLayout.addComponent(this.userField, 7, 0, 7, 1); final Button queryBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SUBMIT), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { fromDate = fromDateField.getValue(); toDate = toDateField.getValue(); searchCriteria.setRangeDate(new RangeDateSearchField(fromDate, toDate)); searchTimeReporting(); } }); queryBtn.setStyleName(UIConstants.THEME_GREEN_LINK); selectionLayout.addComponent(queryBtn, 8, 0); loggingPanel.setWidth("100%"); loggingPanel.setHeight("80px"); loggingPanel.setSpacing(true); totalHoursLoggingLabel = new Label("Total Hours Logging: 0 Hrs", ContentMode.HTML); totalHoursLoggingLabel.addStyleName(UIConstants.LAYOUT_LOG); totalHoursLoggingLabel.addStyleName(UIConstants.TEXT_LOG_DATE_FULL); loggingPanel.addComponent(totalHoursLoggingLabel); loggingPanel.setExpandRatio(totalHoursLoggingLabel, 1.0f); loggingPanel.setComponentAlignment(totalHoursLoggingLabel, Alignment.MIDDLE_LEFT); Button exportBtn = new Button("Export", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { exportButtonControl.setPopupVisible(true); } }); exportButtonControl = new SplitButton(exportBtn); exportButtonControl.setWidthUndefined(); exportButtonControl.addStyleName(UIConstants.THEME_GRAY_LINK); exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK); VerticalLayout popupButtonsControl = new VerticalLayout(); exportButtonControl.setContent(popupButtonsControl); Button exportPdfBtn = new Button("Pdf"); FileDownloader pdfDownloader = new FileDownloader(constructStreamResource(ReportExportType.PDF)); pdfDownloader.extend(exportPdfBtn); exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O); exportPdfBtn.setStyleName("link"); popupButtonsControl.addComponent(exportPdfBtn); Button exportExcelBtn = new Button("Excel"); FileDownloader excelDownloader = new FileDownloader(constructStreamResource(ReportExportType.EXCEL)); excelDownloader.extend(exportExcelBtn); exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O); exportExcelBtn.setStyleName("link"); popupButtonsControl.addComponent(exportExcelBtn); controlBtns.addComponent(exportButtonControl); controlBtns.setComponentAlignment(exportButtonControl, Alignment.TOP_RIGHT); controlBtns.setComponentAlignment(backBtn, Alignment.TOP_LEFT); controlBtns.setSizeFull(); this.timeTrackingWrapper = new VerticalLayout(); this.timeTrackingWrapper.setWidth("100%"); contentWrapper.addComponent(this.timeTrackingWrapper); Calendar date = new GregorianCalendar(); date.set(Calendar.DAY_OF_MONTH, 1); fromDate = date.getTime(); date.add(Calendar.DAY_OF_MONTH, date.getActualMaximum(Calendar.DAY_OF_MONTH)); toDate = date.getTime(); fromDateField.setValue(fromDate); toDateField.setValue(toDate); searchCriteria = new ItemTimeLoggingSearchCriteria(); searchCriteria.setRangeDate(new RangeDateSearchField(fromDate, toDate)); } else { final Button backBtn = new Button("Back to Workboard"); backBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance() .post(new ShellEvent.GotoProjectModule(TimeTrackingSummaryViewImpl.this, null)); } }); backBtn.addStyleName(UIConstants.THEME_GREEN_LINK); backBtn.setIcon(FontAwesome.ARROW_LEFT); VerticalLayout contentWrapper = new VerticalLayout(); contentWrapper.setSpacing(true); Label infoLbl = new Label("You are not involved in any project yet to track time working"); infoLbl.setWidthUndefined(); contentWrapper.setMargin(true); contentWrapper.addComponent(infoLbl); contentWrapper.setComponentAlignment(infoLbl, Alignment.MIDDLE_CENTER); contentWrapper.addComponent(backBtn); contentWrapper.setComponentAlignment(backBtn, Alignment.MIDDLE_CENTER); this.addComponent(contentWrapper); this.setComponentAlignment(contentWrapper, Alignment.MIDDLE_CENTER); } }