{
final SubmitLink previousButton = new SubmitLink("previousMonth") {
@Override
public void onSubmit()
{
final DateHolder dateHolder = new DateHolder(getModelObject());
dateHolder.add(Calendar.MONTH, -1);
dateHolder.setBeginOfMonth();
beginOfMonth = dateHolder.getDate();
caller.select(selectProperty, beginOfMonth);
};
};
previousButton.setDefaultFormProcessing(false);
add(previousButton);
previousButton.add(new TooltipImage("previousMonthImage", WebConstants.IMAGE_QUICKSELECT_PREVIOUS_MONTH,
getString("calendar.quickselect.tooltip.selectPreviousMonth")));
}
{
final SubmitLink currentMonthButton = new SubmitLink("currentMonth") {
@Override
public void onSubmit()
{
final DateHolder dateHolder = new DateHolder();
dateHolder.setBeginOfMonth();
beginOfMonth = dateHolder.getDate();
caller.select(selectProperty, beginOfMonth);
};
};
currentMonthButton.setDefaultFormProcessing(false);
add(currentMonthButton);
currentMonthButton.add(new TooltipImage("currentMonthImage", WebConstants.IMAGE_QUICKSELECT_CURRENT_MONTH,
getString("calendar.quickselect.tooltip.selectCurrentMonth")));
}
{
final SubmitLink followingMonthButton = new SubmitLink("followingMonth") {
@Override
public void onSubmit()
{
final DateHolder dateHolder = new DateHolder(getModelObject());
dateHolder.add(Calendar.MONTH, +1);
beginOfMonth = dateHolder.getDate();
caller.select(selectProperty, beginOfMonth);
};
};
followingMonthButton.setDefaultFormProcessing(false);
add(followingMonthButton);