render offer view after main thread loaded
Some checks failed
CI / build (macos-13) (push) Has been cancelled
CI / build (ubuntu-22.04) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
Codacy Coverage Reporter / Publish coverage (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled

This commit is contained in:
woodser 2025-01-09 11:01:25 -05:00
parent d9f9c1e736
commit b0c1dceb56

View file

@ -424,7 +424,7 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
currencySelectionSubscriber = currencySelectionBinding.subscribe((observable, oldValue, newValue) -> {
});
tableView.setItems(model.getOfferList());
UserThread.execute(() -> tableView.setItems(model.getOfferList()));
model.getOfferList().addListener(offerListListener);
nrOfOffersLabel.setText(Res.get("offerbook.nrOffers", model.getOfferList().size()));
@ -788,13 +788,11 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
return new TableCell<>() {
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty)
setGraphic(new ColoredDecimalPlacesWithZerosText(model.getAmount(item), GUIUtil.AMOUNT_DECIMALS_WITH_ZEROS));
else
setGraphic(null);
});
}
};
}
@ -819,13 +817,11 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty)
setText(CurrencyUtil.getCurrencyPair(item.getOffer().getCurrencyCode()));
else
setText("");
});
}
};
}
@ -855,7 +851,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
return new TableCell<>() {
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty) {
@ -863,7 +858,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
} else {
setGraphic(null);
}
});
}
private HBox getPriceAndPercentage(OfferBookListItem item) {
@ -939,7 +933,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
return new TableCell<>() {
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty) {
@ -955,7 +948,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
setText("");
setGraphic(null);
}
});
}
};
}
@ -981,7 +973,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty) {
@ -1006,7 +997,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
if (field != null)
field.setOnAction(null);
}
});
}
};
}
@ -1035,7 +1025,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
return new TableCell<>() {
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty) {
@ -1056,7 +1045,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
setText("");
setGraphic(null);
}
});
}
};
}
@ -1083,7 +1071,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
final ImageView iconView = new ImageView();
@ -1190,7 +1177,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
tableRow.setOnMousePressed(null);
}
}
});
}
};
}
@ -1218,7 +1204,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
return new TableCell<>() {
@Override
public void updateItem(final OfferBookListItem item, boolean empty) {
UserThread.execute(() -> {
super.updateItem(item, empty);
if (item != null && !empty) {
@ -1230,7 +1215,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
} else {
setGraphic(null);
}
});
}
};
}
@ -1256,7 +1240,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
return new TableCell<>() {
@Override
public void updateItem(final OfferBookListItem newItem, boolean empty) {
UserThread.execute(() -> {
super.updateItem(newItem, empty);
if (newItem != null && !empty) {
final Offer offer = newItem.getOffer();
@ -1275,7 +1258,6 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
} else {
setGraphic(null);
}
});
}
};
}