initHideWeekEndButton();
initReadOnlyButton();
initDisabledButton();
initAddNewEventButton();
HorizontalLayout hl = new HorizontalLayout();
hl.setWidth("100%");
hl.setSpacing(true);
hl.addComponent(prevButton);
hl.addComponent(captionLabel);
CssLayout group = new CssLayout();
group.addStyleName("v-component-group");
group.addComponent(dayButton);
group.addComponent(weekButton);
group.addComponent(monthButton);
hl.addComponent(group);
hl.addComponent(nextButton);
hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT);
hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER);
hl.setComponentAlignment(group, Alignment.MIDDLE_CENTER);
hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT);
// monthButton.setVisible(viewMode == Mode.WEEK);
// weekButton.setVisible(viewMode == Mode.DAY);
HorizontalLayout controlPanel = new HorizontalLayout();
controlPanel.setSpacing(true);
controlPanel.setWidth("100%");
controlPanel.addComponent(localeSelect);
controlPanel.addComponent(timeZoneSelect);
controlPanel.addComponent(formatSelect);
controlPanel.addComponent(hideWeekendsButton);
controlPanel.addComponent(readOnlyButton);
controlPanel.addComponent(disabledButton);
controlPanel.addComponent(addNewEvent);
controlPanel.setComponentAlignment(timeZoneSelect,
Alignment.MIDDLE_LEFT);
controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT);
controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT);
controlPanel.setComponentAlignment(hideWeekendsButton,
Alignment.MIDDLE_LEFT);
controlPanel.setComponentAlignment(readOnlyButton,
Alignment.MIDDLE_LEFT);
controlPanel.setComponentAlignment(disabledButton,
Alignment.MIDDLE_LEFT);
controlPanel.setComponentAlignment(addNewEvent, Alignment.MIDDLE_LEFT);
Label viewCaption = new Label("Calendar");
viewCaption.setStyleName(ValoTheme.LABEL_H1);
addComponent(viewCaption);
addComponent(controlPanel);