use of com.vaadin.ui.NativeButton in project VaadinUtils by rlsutton1.
the class JasperReportLayout method createScheduleButton.
private void createScheduleButton(String buttonHeight, HorizontalLayout buttonContainer) {
scheduleButton = new NativeButton();
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/");
// 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.setDescription("Schedule");
scheduleButton.setWidth("50");
scheduleButton.setHeight(buttonHeight);
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);
}
use of com.vaadin.ui.NativeButton in project VaadinUtils by rlsutton1.
the class TimePicker method addHourButtons.
protected void addHourButtons(HorizontalLayout hourButtonPanel, int rows, int cols) {
int[] numbers = new int[] { 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
for (int col = 0; col < cols; col++) {
VerticalLayout rowsLayout = new VerticalLayout();
for (int row = 0; row < rows; row++) {
final NativeButton button = new NativeButton("" + numbers[col + (row * cols)]);
rowsLayout.addComponent(button);
button.setStyleName(Reindeer.BUTTON_SMALL);
button.setWidth("30");
button.addClickListener(new ClickListener() {
/**
*/
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
int hourToSet = Integer.parseInt(button.getCaption());
hourToSet %= 12;
if (dateTime.get(Calendar.HOUR_OF_DAY) >= 12) {
hourToSet += 12;
}
dateTime.set(Calendar.HOUR_OF_DAY, hourToSet);
isSet = true;
setNewValue();
}
});
}
hourButtonPanel.addComponent(rowsLayout);
}
}
use of com.vaadin.ui.NativeButton in project VaadinUtils by rlsutton1.
the class TimePicker method addAmPmButtons.
protected void addAmPmButtons(VerticalLayout amPmButtonPanel) {
final NativeButton am = new NativeButton("AM");
final NativeButton pm = new NativeButton("PM");
amPmButtonPanel.addComponent(am);
amPmButtonPanel.addComponent(pm);
am.setStyleName(Reindeer.BUTTON_SMALL);
am.setWidth("35");
am.addClickListener(new ClickListener() {
/**
*/
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
dateTime.set(Calendar.AM_PM, Calendar.AM);
isSet = true;
setNewValue();
}
});
pm.setStyleName(Reindeer.BUTTON_SMALL);
pm.setWidth("35");
pm.addClickListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
dateTime.set(Calendar.AM_PM, Calendar.PM);
isSet = true;
setNewValue();
}
});
}
use of com.vaadin.ui.NativeButton in project VaadinUtils by rlsutton1.
the class TimePicker24 method addHourButtons.
private void addHourButtons(HorizontalLayout hourButtonPanel, int rows, int cols) {
int[] numbers = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
for (int col = 0; col < cols; col++) {
VerticalLayout rowsLayout = new VerticalLayout();
for (int row = 0; row < rows; row++) {
final NativeButton button = new NativeButton("" + numbers[col + (row * cols)]);
rowsLayout.addComponent(button);
button.setStyleName(Reindeer.BUTTON_SMALL);
button.setWidth("30");
// button.setHeight("15");
// button.setAutoFit(false);
// button.setActionType(SelectionType.RADIO);
// button.addToRadioGroup("hourButtons");
// if (row == 0 && col == 0)
// {
// zeroHourButton = button;
//
// }
button.addClickListener(new ClickListener() {
/**
*/
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
String title = button.getCaption();
hour = title;
isSet = true;
amPm = AM;
if (Integer.parseInt(hour) > 11) {
amPm = PM;
}
setNewValue();
}
});
}
hourButtonPanel.addComponent(rowsLayout);
}
}
use of com.vaadin.ui.NativeButton in project VaadinUtils by rlsutton1.
the class JasperReportLayout method createEmailButton.
private void createEmailButton(String buttonHeight, HorizontalLayout buttonContainer) {
emailButton = new NativeButton();
emailButton.setIcon(new ExternalResource("images/seanau/Send Email_32.png"));
emailButton.setDescription("Email");
emailButton.setWidth("50");
emailButton.setHeight(buttonHeight);
emailButton.addClickListener(new ClickEventLogged.ClickListener() {
private static final long serialVersionUID = 7207441556779172217L;
@Override
public void clicked(ClickEvent event) {
new JasperReportEmailWindow(reportProperties, builder.getReportParameters());
}
});
buttonContainer.addComponent(emailButton);
}
Aggregations