* Adds custom buttons to the toolbar.
*/
private void initToolbarMenu() {
GroupingToolbar.View toolbarUi = searchUi.getToolbar();
ToolbarView group = toolbarUi.addGroup();
new ToolbarButtonViewBuilder().setText(messages.newWave()).applyTo(
group.addClickButton(), new ToolbarClickButton.Listener() {
@Override
public void onClicked() {
actionHandler.onCreateWave();
// HACK(hearnden): To mimic live search, fire a search poll
// reasonably soon (500ms) after creating a wave. This will be unnecessary
// with a real live search implementation. The delay is to give
// enough time for the wave state to propagate to the server.
int delay = 500;
scheduler.scheduleRepeating(searchUpdater, delay, POLLING_INTERVAL_MS);
}
});
// Fake group with empty button - to force the separator be displayed.
group = toolbarUi.addGroup();
new ToolbarButtonViewBuilder().setText("").applyTo(group.addClickButton(), null);
}