ConversationView wave, Reader reader) {
return new ViewToolbar(new ToplevelToolbarWidget(), focus, views, wave, reader);
}
public void init() {
ToolbarView group = toolbarUi.addGroup();
new ToolbarButtonViewBuilder().setText(messages.recent()).applyTo(
group.addClickButton(), new ToolbarClickButton.Listener() {
@Override
public void onClicked() {
focusFrame.focus(blipSelector.selectMostRecentlyModified());
}
});
new ToolbarButtonViewBuilder().setText(messages.nextUnread()).applyTo(
group.addClickButton(), new ToolbarClickButton.Listener() {
@Override
public void onClicked() {
BlipView focusedBlip = focusFrame.getFocusedBlip();
if (focusedBlip == null) {
focusedBlip = blipSelector.getOrFindRootBlip();
boolean isRead = reader.isRead(focusedBlip);
focusFrame.focus(focusedBlip);
if (isRead) {
focusFrame.focusNext();
}
} else {
focusFrame.focusNext();
}
}
});
new ToolbarButtonViewBuilder().setText(messages.previous()).applyTo(
group.addClickButton(), new ToolbarClickButton.Listener() {
@Override
public void onClicked() {
focusFrame.moveUp();
}
});
new ToolbarButtonViewBuilder().setText(messages.next()).applyTo(
group.addClickButton(), new ToolbarClickButton.Listener() {
@Override
public void onClicked() {
focusFrame.moveDown();
}
});
// Fake group
group = toolbarUi.addGroup();
new ToolbarButtonViewBuilder().setText("").applyTo(group.addClickButton(), null);
}