use of au.com.vaadinutils.jasper.scheduler.JasperReportSchedulerWindow in project VaadinUtils by rlsutton1.
the class JasperReportLayout method createScheduleButton.
private void createScheduleButton(String buttonHeight, HorizontalLayout buttonContainer) {
scheduleButton = new Button();
Resource scheduleButtonIcon = reportProperties.getScheduleButtonIconResource();
if (scheduleButtonIcon == null) {
scheduleButtonIcon = new ExternalResource("images/seanau/Call Calendar_32.png");
}
// JpaBaseDao<ReportEmailScheduleEntity, Long> dao =
// JpaBaseDao.getGenericDao(ReportEmailScheduleEntity.class);
// Long count =
// dao.getCount(ReportEmailScheduleEntity_.JasperReportPropertiesClassName,
// reportProperties.getReportClass().getCanonicalName());
//
// ScheduleIconBuilder iconBuilder = new ScheduleIconBuilder();
//
// String baseIconFileName = "Call Calendar_32";
// String path =
// VaadinServlet.getCurrent().getServletContext().getRealPath("templates/images/seanau/");
//
// // HACK: scoutmaster stores images in a different directory so if the
// // images isn't found in the above templates directory
// // then search in the /images/seanau director.
// if (path == null || !new File(path).exists())
// {
// path =
// VaadinServlet.getCurrent().getServletContext().getRealPath("/images/seanau/");
// }
// String targetFileName = baseIconFileName + "-" + count + ".png";
// iconBuilder.buildLogo(count.intValue(), new File(path),
// baseIconFileName + ".png", targetFileName);
// scheduleButton.setIcon(new ExternalResource("images/seanau/" +
// targetFileName));
scheduleButton.setIcon(scheduleButtonIcon);
scheduleButton.setDescription("Schedule");
scheduleButton.setWidth("" + BUTTON_WIDTH);
scheduleButton.setHeight(buttonHeight);
scheduleButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
scheduleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
scheduleButton.addClickListener(new ClickEventLogged.ClickListener() {
private static final long serialVersionUID = 7207441556779172217L;
@Override
public void clicked(ClickEvent event) {
new JasperReportSchedulerWindow(reportProperties, builder.getReportParameters());
}
});
buttonContainer.addComponent(scheduleButton);
}
Aggregations