mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 14:42:37 +01:00
commit
fd97c3c7f9
13 changed files with 123 additions and 88 deletions
|
@ -24,7 +24,7 @@ dependencies {
|
|||
compile project(':assets')
|
||||
compile project(':p2p')
|
||||
compile 'net.sf.jopt-simple:jopt-simple:5.0.3'
|
||||
compile('network.bisq.btcd-cli4j:btcd-cli4j-core:1763d7ef') {
|
||||
compile('network.bisq.btcd-cli4j:btcd-cli4j-core:3864e1c4') {
|
||||
exclude(module: 'slf4j-api')
|
||||
exclude(module: 'httpclient')
|
||||
exclude(module: 'commons-lang3')
|
||||
|
@ -32,7 +32,7 @@ dependencies {
|
|||
exclude(module: 'jackson-annotations')
|
||||
exclude(module: 'jackson-databind')
|
||||
}
|
||||
compile('network.bisq.btcd-cli4j:btcd-cli4j-daemon:1763d7ef') {
|
||||
compile('network.bisq.btcd-cli4j:btcd-cli4j-daemon:3864e1c4') {
|
||||
exclude(module: 'slf4j-api')
|
||||
exclude(module: 'httpclient')
|
||||
exclude(module: 'commons-lang3')
|
||||
|
|
|
@ -82,7 +82,7 @@ import javax.annotation.Nullable;
|
|||
* Provides a facade to interact with the Dao domain. Hides complexity and domain details to clients (e.g. UI or APIs)
|
||||
* by providing a reduced API and/or aggregating subroutines.
|
||||
*/
|
||||
public class DaoFacade {
|
||||
public class DaoFacade implements DaoSetupService {
|
||||
private final ProposalListPresentation proposalListPresentation;
|
||||
private final BallotListService ballotListService;
|
||||
private final BallotListPresentation ballotListPresentation;
|
||||
|
@ -135,7 +135,19 @@ public class DaoFacade {
|
|||
this.lockupService = lockupService;
|
||||
this.unlockService = unlockService;
|
||||
this.proposalConsensus = proposalConsensus;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// DaoSetupService
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void addListeners() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
bsqStateService.addBsqStateListener(new BsqStateListener() {
|
||||
@Override
|
||||
public void onNewBlockHeight(int blockHeight) {
|
||||
|
@ -153,6 +165,7 @@ public class DaoFacade {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
public void addBsqStateListener(BsqStateListener listener) {
|
||||
bsqStateService.addBsqStateListener(listener);
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ public class DaoSetup {
|
|||
private final VoteRevealService voteRevealService;
|
||||
private final VoteResultService voteResultService;
|
||||
private final BsqNode bsqNode;
|
||||
private final DaoFacade daoFacade;
|
||||
private final ExportJsonFilesService exportJsonFilesService;
|
||||
|
||||
@Inject
|
||||
|
@ -59,6 +60,7 @@ public class DaoSetup {
|
|||
MyBlindVoteListService myBlindVoteListService,
|
||||
VoteRevealService voteRevealService,
|
||||
VoteResultService voteResultService,
|
||||
DaoFacade daoFacade,
|
||||
ExportJsonFilesService exportJsonFilesService) {
|
||||
this.bsqStateService = bsqStateService;
|
||||
this.cycleService = cycleService;
|
||||
|
@ -68,6 +70,7 @@ public class DaoSetup {
|
|||
this.myBlindVoteListService = myBlindVoteListService;
|
||||
this.voteRevealService = voteRevealService;
|
||||
this.voteResultService = voteResultService;
|
||||
this.daoFacade = daoFacade;
|
||||
this.exportJsonFilesService = exportJsonFilesService;
|
||||
|
||||
bsqNode = bsqNodeProvider.getBsqNode();
|
||||
|
@ -85,6 +88,7 @@ public class DaoSetup {
|
|||
voteRevealService.addListeners();
|
||||
voteResultService.addListeners();
|
||||
exportJsonFilesService.addListeners();
|
||||
daoFacade.addListeners();
|
||||
|
||||
bsqStateService.start();
|
||||
cycleService.start();
|
||||
|
@ -95,6 +99,7 @@ public class DaoSetup {
|
|||
voteRevealService.start();
|
||||
voteResultService.start();
|
||||
exportJsonFilesService.start();
|
||||
daoFacade.start();
|
||||
|
||||
bsqNode.setErrorMessageHandler(errorMessageHandler);
|
||||
bsqNode.start();
|
||||
|
|
|
@ -75,13 +75,13 @@ public class BallotListPresentation implements BallotListService.BallotListChang
|
|||
|
||||
@Override
|
||||
public void onParseTxsComplete(Block block) {
|
||||
onListChanged(ballotListService.getBallotList().getList());
|
||||
onListChanged(ballotListService.getValidatedBallotList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParseBlockChainComplete() {
|
||||
// As we update the list in ProposalService.onParseBlockChainComplete we need to update here as well.
|
||||
onListChanged(ballotListService.getBallotList().getList());
|
||||
onListChanged(ballotListService.getValidatedBallotList());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ public class BallotListService implements PersistedDataHost, DaoSetupService {
|
|||
.map(ProposalPayload::getProposal)
|
||||
.filter(proposal -> ballotList.stream()
|
||||
.noneMatch(ballot -> ballot.getProposal().equals(proposal)))
|
||||
.filter(proposalValidator::isTxTypeValid)
|
||||
.forEach(proposal -> {
|
||||
Ballot ballot = new Ballot(proposal); // vote is null
|
||||
log.info("We create a new ballot with a proposal and add it to our list. " +
|
||||
|
@ -110,9 +109,7 @@ public class BallotListService implements PersistedDataHost, DaoSetupService {
|
|||
BallotList persisted = storage.initAndGetPersisted(ballotList, 100);
|
||||
if (persisted != null) {
|
||||
ballotList.clear();
|
||||
persisted.getList().stream()
|
||||
.filter(ballot -> proposalValidator.isTxTypeValid(ballot.getProposal()))
|
||||
.forEach(ballotList::add);
|
||||
ballotList.addAll(persisted.getList());
|
||||
listeners.forEach(l -> l.onListChanged(ballotList.getList()));
|
||||
}
|
||||
}
|
||||
|
@ -132,12 +129,15 @@ public class BallotListService implements PersistedDataHost, DaoSetupService {
|
|||
listeners.add(listener);
|
||||
}
|
||||
|
||||
public BallotList getBallotList() {
|
||||
return ballotList;
|
||||
public List<Ballot> getValidatedBallotList() {
|
||||
return ballotList.stream()
|
||||
.filter(ballot -> proposalValidator.isTxTypeValid(ballot.getProposal()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<Ballot> getBallotsOfCycle() {
|
||||
public List<Ballot> getValidBallotsOfCycle() {
|
||||
return ballotList.stream()
|
||||
.filter(ballot -> proposalValidator.isTxTypeValid(ballot.getProposal()))
|
||||
.filter(ballot -> periodService.isTxInCorrectCycle(ballot.getTxId(), periodService.getChainHeight()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class BlindVoteConsensus {
|
|||
}
|
||||
|
||||
public static BallotList getSortedBallotList(BallotListService ballotListService) {
|
||||
List<Ballot> ballotList = ballotListService.getBallotsOfCycle().stream()
|
||||
List<Ballot> ballotList = ballotListService.getValidBallotsOfCycle().stream()
|
||||
.sorted(Comparator.comparing(Ballot::getTxId))
|
||||
.collect(Collectors.toList());
|
||||
log.info("Sorted ballotList: " + ballotList);
|
||||
|
|
|
@ -45,6 +45,9 @@ import javax.inject.Named;
|
|||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
@ -174,6 +177,19 @@ public class ProposalService implements HashMapChangedListener, AppendOnlyDataSt
|
|||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Getter
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public List<Proposal> getValidatedProposals() {
|
||||
return proposalPayloads.stream()
|
||||
.map(proposalPayload -> proposalPayload.getProposal())
|
||||
.filter(proposal -> proposalValidator.isTxTypeValid(proposal))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -243,14 +259,9 @@ public class ProposalService implements HashMapChangedListener, AppendOnlyDataSt
|
|||
if (!proposalPayloads.contains(proposalPayload)) {
|
||||
Proposal proposal = proposalPayload.getProposal();
|
||||
if (proposalValidator.areDataFieldsValid(proposal)) {
|
||||
if (proposalValidator.isTxTypeValid(proposal)) {
|
||||
proposalPayloads.add(proposalPayload);
|
||||
log.info("We received a ProposalPayload and store it to our appendOnlyStoreList. proposalTxId={}",
|
||||
proposal.getTxId());
|
||||
} else {
|
||||
log.warn("We received a proposal with an invalid txId. Proposal.txId={}",
|
||||
proposal.getTxId());
|
||||
}
|
||||
proposalPayloads.add(proposalPayload);
|
||||
log.info("We received a ProposalPayload and store it to our appendOnlyStoreList. proposalTxId={}",
|
||||
proposal.getTxId());
|
||||
} else {
|
||||
log.warn("We received a invalid append-only proposal from the P2P network. " +
|
||||
"Proposal.txId={}, blockHeight={}",
|
||||
|
|
|
@ -79,6 +79,8 @@ public class ProposalValidator {
|
|||
}
|
||||
Optional<TxType> optionalTxType = bsqStateService.getOptionalTxType(txId);
|
||||
boolean present = optionalTxType.filter(txType -> txType == proposal.getTxType()).isPresent();
|
||||
if (!present)
|
||||
log.debug("optionalTxType not present for proposal {}" + proposal);
|
||||
return present;
|
||||
}
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ public class VoteResultService implements BsqStateListener, DaoSetupService {
|
|||
.collect(Collectors.toMap(VoteWithProposalTxId::getProposalTxId, VoteWithProposalTxId::getVote));
|
||||
|
||||
// We make a map with proposalTxId as key and the ballot as value out of our stored ballot list
|
||||
Map<String, Ballot> ballotByTxIdMap = ballotListService.getBallotList().stream()
|
||||
Map<String, Ballot> ballotByTxIdMap = ballotListService.getValidatedBallotList().stream()
|
||||
.collect(Collectors.toMap(Ballot::getTxId, ballot -> ballot));
|
||||
|
||||
List<String> missingBallots = new ArrayList<>();
|
||||
|
|
|
@ -158,7 +158,7 @@ public class FullNode extends BsqNode {
|
|||
if (newChainHeadHeight > chainHeadHeight) {
|
||||
log.info("During parsing new blocks have arrived. We parse again with those missing blocks." +
|
||||
"ChainHeadHeight={}, newChainHeadHeight={}", chainHeadHeight, newChainHeadHeight);
|
||||
parseBlocksOnHeadHeight(chainHeadHeight, newChainHeadHeight);
|
||||
parseBlocksOnHeadHeight(chainHeadHeight + 1, newChainHeadHeight);
|
||||
} else {
|
||||
log.info("parseBlocksIfNewBlockAvailable did not result in a new block, so we complete.");
|
||||
onParseBlockChainComplete();
|
||||
|
@ -239,9 +239,12 @@ public class FullNode extends BsqNode {
|
|||
}
|
||||
|
||||
private void handleError(Throwable throwable) {
|
||||
String errorMessage = "Initializing FullNode failed: Error=" + throwable.toString();
|
||||
String errorMessage = "An error occurred: Error=" + throwable.toString();
|
||||
log.error(errorMessage);
|
||||
|
||||
if (throwable instanceof BlockNotConnectingException)
|
||||
startReOrgFromLastSnapshot();
|
||||
|
||||
if (errorMessageHandler != null)
|
||||
errorMessageHandler.handleErrorMessage(errorMessage);
|
||||
}
|
||||
|
|
|
@ -162,6 +162,11 @@ public class RpcService {
|
|||
daemon.addBlockListener(new BlockListener() {
|
||||
@Override
|
||||
public void blockDetected(com.neemre.btcdcli4j.core.domain.RawBlock rawBtcBlock) {
|
||||
if (rawBtcBlock.getHeight() == null || rawBtcBlock.getHeight() == 0) {
|
||||
log.warn("We received a RawBlock with no data. blockHash={}", rawBtcBlock.getHash());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
log.info("New block received: height={}, id={}", rawBtcBlock.getHeight(), rawBtcBlock.getHash());
|
||||
List<RawTx> txList = rawBtcBlock.getTx().stream()
|
||||
|
@ -204,7 +209,7 @@ public class RpcService {
|
|||
List<RawTx> txList = rawBtcBlock.getTx().stream()
|
||||
.map(e -> getTxFromRawTransaction(e, rawBtcBlock))
|
||||
.collect(Collectors.toList());
|
||||
log.info("requestBtcBlock with all txs took {} ms at blockHeight {}; txList.size={}",
|
||||
log.debug("requestBtcBlock with all txs took {} ms at blockHeight {}; txList.size={}",
|
||||
System.currentTimeMillis() - startTs, blockHeight, txList.size());
|
||||
return new RawBlock(rawBtcBlock.getHeight(),
|
||||
rawBtcBlock.getTime() * 1000, // rawBtcBlock.getTime() is in sec but we want ms
|
||||
|
|
|
@ -20,8 +20,9 @@ package bisq.desktop.main.dao.governance.result;
|
|||
import bisq.core.dao.governance.proposal.Proposal;
|
||||
import bisq.core.dao.governance.voteresult.DecryptedBallotsWithMerits;
|
||||
import bisq.core.dao.governance.voteresult.EvaluatedProposal;
|
||||
import bisq.core.dao.state.BsqStateService;
|
||||
import bisq.core.dao.state.blockchain.Block;
|
||||
import bisq.core.dao.state.period.Cycle;
|
||||
import bisq.core.util.BsqFormatter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -33,12 +34,14 @@ import lombok.extern.slf4j.Slf4j;
|
|||
class ResultsOfCycle {
|
||||
private final Cycle cycle;
|
||||
private final int cycleIndex;
|
||||
private final int numVotes, numAcceptedVotes, numRejectedVotes;
|
||||
private BsqFormatter bsqFormatter;
|
||||
private final int numVotes;
|
||||
private final int numAcceptedVotes;
|
||||
private final int numRejectedVotes;
|
||||
private final BsqStateService bsqStateService;
|
||||
private long cycleStartTime;
|
||||
|
||||
// All available proposals of cycle
|
||||
private List<Proposal> proposals;
|
||||
private final List<Proposal> proposals;
|
||||
|
||||
// Proposals which ended up in voting
|
||||
private final List<EvaluatedProposal> evaluatedProposals;
|
||||
|
@ -50,7 +53,8 @@ class ResultsOfCycle {
|
|||
long cycleStartTime,
|
||||
List<Proposal> proposals,
|
||||
List<EvaluatedProposal> evaluatedProposals,
|
||||
List<DecryptedBallotsWithMerits> decryptedVotesForCycle) {
|
||||
List<DecryptedBallotsWithMerits> decryptedVotesForCycle,
|
||||
BsqStateService bsqStateService) {
|
||||
this.cycle = cycle;
|
||||
this.cycleIndex = cycleIndex;
|
||||
this.cycleStartTime = cycleStartTime;
|
||||
|
@ -67,5 +71,16 @@ class ResultsOfCycle {
|
|||
numRejectedVotes = evaluatedProposals.stream()
|
||||
.mapToInt(e -> e.getProposalVoteResult().getNumRejectedVotes())
|
||||
.sum();
|
||||
this.bsqStateService = bsqStateService;
|
||||
}
|
||||
|
||||
public long getCycleStartTime() {
|
||||
// At a new cycle we have cycleStartTime 0 as the block is not processed yet.
|
||||
// To display a correct value we access again from the bsqStateService
|
||||
if (cycleStartTime == 0)
|
||||
cycleStartTime = bsqStateService.getBlockAtHeight(cycle.getHeightOfFirstBlock())
|
||||
.map(Block::getTime)
|
||||
.orElse(0L);
|
||||
return cycleStartTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import bisq.core.dao.DaoFacade;
|
|||
import bisq.core.dao.governance.ballot.Ballot;
|
||||
import bisq.core.dao.governance.proposal.Proposal;
|
||||
import bisq.core.dao.governance.proposal.ProposalService;
|
||||
import bisq.core.dao.governance.proposal.storage.appendonly.ProposalPayload;
|
||||
import bisq.core.dao.governance.voteresult.DecryptedBallotsWithMerits;
|
||||
import bisq.core.dao.governance.voteresult.EvaluatedProposal;
|
||||
import bisq.core.dao.governance.voteresult.VoteResultService;
|
||||
|
@ -242,8 +241,7 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
private void fillCycleList() {
|
||||
cycleListItemList.clear();
|
||||
bsqStateService.getCycles().forEach(cycle -> {
|
||||
List<Proposal> proposalsForCycle = proposalService.getProposalPayloads().stream()
|
||||
.map(ProposalPayload::getProposal)
|
||||
List<Proposal> proposalsForCycle = proposalService.getValidatedProposals().stream()
|
||||
.filter(proposal -> cycleService.isTxInCycle(cycle, proposal.getTxId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
@ -265,7 +263,8 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
cycleStartTime,
|
||||
proposalsForCycle,
|
||||
evaluatedProposalsForCycle,
|
||||
decryptedVotesForCycle);
|
||||
decryptedVotesForCycle,
|
||||
bsqStateService);
|
||||
CycleListItem cycleListItem = new CycleListItem(resultsOfCycle, bsqStateService, bsqFormatter);
|
||||
cycleListItemList.add(cycleListItem);
|
||||
});
|
||||
|
@ -421,12 +420,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(160);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<CycleListItem, CycleListItem>, TableCell<CycleListItem,
|
||||
CycleListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<CycleListItem, CycleListItem> call(
|
||||
TableColumn<CycleListItem, CycleListItem> column) {
|
||||
return new TableCell<CycleListItem, CycleListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final CycleListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -446,12 +444,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMaxWidth(90);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<CycleListItem, CycleListItem>, TableCell<CycleListItem,
|
||||
CycleListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<CycleListItem, CycleListItem> call(
|
||||
TableColumn<CycleListItem, CycleListItem> column) {
|
||||
return new TableCell<CycleListItem, CycleListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final CycleListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -471,12 +468,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMaxWidth(70);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<CycleListItem, CycleListItem>, TableCell<CycleListItem,
|
||||
CycleListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<CycleListItem, CycleListItem> call(
|
||||
TableColumn<CycleListItem, CycleListItem> column) {
|
||||
return new TableCell<CycleListItem, CycleListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final CycleListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -495,12 +491,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(70);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<CycleListItem, CycleListItem>, TableCell<CycleListItem,
|
||||
CycleListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<CycleListItem, CycleListItem> call(
|
||||
TableColumn<CycleListItem, CycleListItem> column) {
|
||||
return new TableCell<CycleListItem, CycleListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final CycleListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -519,12 +514,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(70);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<CycleListItem, CycleListItem>, TableCell<CycleListItem,
|
||||
CycleListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<CycleListItem, CycleListItem> call(
|
||||
TableColumn<CycleListItem, CycleListItem> column) {
|
||||
return new TableCell<CycleListItem, CycleListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final CycleListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -553,12 +547,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<ProposalListItem, ProposalListItem>, TableCell<ProposalListItem,
|
||||
ProposalListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(
|
||||
TableColumn<ProposalListItem, ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final ProposalListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -580,12 +573,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(80);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<ProposalListItem, ProposalListItem>, TableCell<ProposalListItem,
|
||||
ProposalListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(
|
||||
TableColumn<ProposalListItem, ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
|
||||
@Override
|
||||
public void updateItem(final ProposalListItem item, boolean empty) {
|
||||
|
@ -609,13 +601,12 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<ProposalListItem, ProposalListItem>, TableCell<ProposalListItem,
|
||||
ProposalListItem>>() {
|
||||
new Callback<>() {
|
||||
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
|
||||
ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
private HyperlinkWithIcon field;
|
||||
|
||||
@Override
|
||||
|
@ -644,12 +635,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(150);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<ProposalListItem, ProposalListItem>, TableCell<ProposalListItem,
|
||||
ProposalListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(
|
||||
TableColumn<ProposalListItem, ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final ProposalListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -669,12 +659,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(180);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<ProposalListItem, ProposalListItem>, TableCell<ProposalListItem,
|
||||
ProposalListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(
|
||||
TableColumn<ProposalListItem, ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final ProposalListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -694,13 +683,12 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(70);
|
||||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<TableColumn<ProposalListItem, ProposalListItem>,
|
||||
TableCell<ProposalListItem, ProposalListItem>>() {
|
||||
column.setCellFactory(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
|
||||
ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
Label myVoteIcon;
|
||||
|
||||
@Override
|
||||
|
@ -728,12 +716,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(90);
|
||||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<TableColumn<ProposalListItem, ProposalListItem>,
|
||||
TableCell<ProposalListItem, ProposalListItem>>() {
|
||||
column.setCellFactory(new Callback<>() {
|
||||
@Override
|
||||
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
|
||||
ProposalListItem> column) {
|
||||
return new TableCell<ProposalListItem, ProposalListItem>() {
|
||||
return new TableCell<>() {
|
||||
Label icon;
|
||||
|
||||
@Override
|
||||
|
@ -771,12 +758,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<VoteListItem, VoteListItem>, TableCell<VoteListItem,
|
||||
VoteListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<VoteListItem, VoteListItem> call(
|
||||
TableColumn<VoteListItem, VoteListItem> column) {
|
||||
return new TableCell<VoteListItem, VoteListItem>() {
|
||||
return new TableCell<>() {
|
||||
private Label icon;
|
||||
|
||||
@Override
|
||||
|
@ -803,12 +789,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(100);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<VoteListItem, VoteListItem>, TableCell<VoteListItem,
|
||||
VoteListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<VoteListItem, VoteListItem> call(
|
||||
TableColumn<VoteListItem, VoteListItem> column) {
|
||||
return new TableCell<VoteListItem, VoteListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final VoteListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -826,12 +811,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(100);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<VoteListItem, VoteListItem>, TableCell<VoteListItem,
|
||||
VoteListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<VoteListItem, VoteListItem> call(
|
||||
TableColumn<VoteListItem, VoteListItem> column) {
|
||||
return new TableCell<VoteListItem, VoteListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final VoteListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -850,12 +834,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(100);
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(
|
||||
new Callback<TableColumn<VoteListItem, VoteListItem>, TableCell<VoteListItem,
|
||||
VoteListItem>>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<VoteListItem, VoteListItem> call(
|
||||
TableColumn<VoteListItem, VoteListItem> column) {
|
||||
return new TableCell<VoteListItem, VoteListItem>() {
|
||||
return new TableCell<>() {
|
||||
@Override
|
||||
public void updateItem(final VoteListItem item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
@ -874,12 +857,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(130);
|
||||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<TableColumn<VoteListItem, VoteListItem>,
|
||||
TableCell<VoteListItem, VoteListItem>>() {
|
||||
column.setCellFactory(new Callback<>() {
|
||||
@Override
|
||||
public TableCell<VoteListItem, VoteListItem> call(TableColumn<VoteListItem,
|
||||
VoteListItem> column) {
|
||||
return new TableCell<VoteListItem, VoteListItem>() {
|
||||
return new TableCell<>() {
|
||||
private HyperlinkWithIcon hyperlinkWithIcon;
|
||||
|
||||
@Override
|
||||
|
@ -909,12 +891,11 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
|||
column.setMinWidth(140);
|
||||
column.setMaxWidth(column.getMinWidth());
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<TableColumn<VoteListItem, VoteListItem>,
|
||||
TableCell<VoteListItem, VoteListItem>>() {
|
||||
column.setCellFactory(new Callback<>() {
|
||||
@Override
|
||||
public TableCell<VoteListItem, VoteListItem> call(TableColumn<VoteListItem,
|
||||
VoteListItem> column) {
|
||||
return new TableCell<VoteListItem, VoteListItem>() {
|
||||
return new TableCell<>() {
|
||||
private HyperlinkWithIcon hyperlinkWithIcon;
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue