The DefaultDateMonthSelector (com.google.gwt.user.datepicker.client) used by the DatePicker does not expose these widgets and hence it is not possible to disable these buttons directly.
To implement this feature, write a new DateMonthSelector (you could start with the source of DefaultMonthSelector http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/datepicker/client/DefaultMonthSelector.java ). For e.g.,
public final class LimitedMonthSelector extends MonthSelector {
// Keep the PushButtons disabled
// Modified from the original DefaultMonthSelector
@Override
protected void setup() {
// Set up backwards.
backwards = new PushButton();
backwards.getUpFace().setHTML("«");
backwards.setStyleName(css().previousButton());
backwards.setEnabled(false); // Disable the back button
forwards = new PushButton();
forwards.getUpFace().setHTML("»");
forwards.setStyleName(css().nextButton());
forwards.setEnabled(false); // Disable the forward button
// Set up grid.
grid = new Grid(1, 3);
grid.setWidget(0, 0, backwards);
grid.setWidget(0, 2, forwards);
CellFormatter formatter = grid.getCellFormatter();
formatter.setStyleName(0, 1, css().month());
formatter.setWidth(0, 0, "1");
formatter.setWidth(0, 1, "100%");
formatter.setWidth(0, 2, "1");
grid.setStyleName(css().monthSelector());
initWidget(grid);
}
}
And then use this MonthSelector implementation in a DatePicker implementation. Like,
public class LimitedDatePicker extends DatePicker {
public MonthYearDatePicker() {
super(new LimitedMonthSelector(), new DefaultCalendarView(), new CalendarModel());
}
}
This new LimitedDatePicker would have its back/forward buttons disabled.