private void createToolBarForWindowsOS(IToolBarManager toolBar) {
toolBar.add(new ControlContribution("rabbit.ui.fromDateTime") {
@Override
protected Control createControl(Composite parent) {
final Calendar dateToBind = preferences.getStartDate();
final DateTime fromDateTime = new DateTime(parent, SWT.DROP_DOWN
| SWT.BORDER);
fromDateTime
.setToolTipText("Select the start date for the data to be displayed");
updateDateTime(fromDateTime, dateToBind);
fromDateTime.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
updateDate(dateToBind, fromDateTime);
}
});
return fromDateTime;
}
});
createSpace(toolBar);
toolBar.add(new ControlContribution("rabbit.ui.toDateTime") {
@Override
protected Control createControl(Composite parent) {
final Calendar dateToBind = preferences.getEndDate();
final DateTime toDateTime = new DateTime(parent, SWT.DROP_DOWN
| SWT.BORDER);
toDateTime
.setToolTipText("Select the end date for the data to be displayed");
updateDateTime(toDateTime, dateToBind);
toDateTime.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
updateDate(dateToBind, toDateTime);
}
});