use of bisq.core.dao.vote.BooleanVoteResult in project bisq-desktop by bisq-network.
the class ActiveProposalsView method onAccept.
private void onAccept() {
selectedProposalListItem.getProposal().setVoteResult(new BooleanVoteResult(true));
updateStateAfterVote();
}
use of bisq.core.dao.vote.BooleanVoteResult in project bisq-desktop by bisq-network.
the class ActiveProposalsView method onReject.
private void onReject() {
selectedProposalListItem.getProposal().setVoteResult(new BooleanVoteResult(false));
updateStateAfterVote();
}
use of bisq.core.dao.vote.BooleanVoteResult in project bisq-desktop by bisq-network.
the class MyVotesView method createProposalColumns.
@Override
protected void createProposalColumns(TableView<ProposalListItem> tableView) {
super.createProposalColumns(tableView);
TableColumn<ProposalListItem, ProposalListItem> actionColumn = new TableColumn<>(Res.get("dao.proposal.votes.header"));
actionColumn.setMinWidth(50);
actionColumn.setMaxWidth(actionColumn.getMinWidth());
actionColumn.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
actionColumn.setCellFactory(new Callback<TableColumn<ProposalListItem, ProposalListItem>, TableCell<ProposalListItem, ProposalListItem>>() {
@Override
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem, ProposalListItem> column) {
return new TableCell<ProposalListItem, ProposalListItem>() {
ImageView actionButtonIconView;
@Override
public void updateItem(final ProposalListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
actionButtonIconView = new ImageView();
VoteResult voteResult = item.getProposal().getVoteResult();
if (voteResult instanceof BooleanVoteResult) {
if (((BooleanVoteResult) voteResult).isAccepted()) {
actionButtonIconView.setId("accepted");
} else {
actionButtonIconView.setId("rejected");
}
} else {
// TODO
}
setGraphic(actionButtonIconView);
} else {
setGraphic(null);
}
}
};
}
});
actionColumn.setComparator(Comparator.comparing(ProposalListItem::getConfirmations));
tableView.getColumns().add(actionColumn);
}
Aggregations