use of org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers in project ovirt-engine by oVirt.
the class AbstractModelBoundPopupPresenterWidget method addFooterButtons.
void addFooterButtons(T model) {
for (int i = model.getCommands().size() - 1; i >= 0; i--) {
UICommand command = model.getCommands().get(i);
final HasUiCommandClickHandlers button = getView().addFooterButton(command.getTitle(), command.getName(), model.getDefaultCommand() != null && model.getDefaultCommand().equals(command));
button.setCommand(command);
// Register command execution handler
registerHandler(button.addClickHandler(event -> {
getView().flush();
beforeCommandExecuted(button.getCommand());
button.getCommand().execute();
}));
}
}
Aggregations