use of org.malai.javafx.command.ProgressableCmd in project Malai by arnobl.
the class BindingTask method call.
@Override
protected Boolean call() {
final DoubleProperty progProp = cmd instanceof ProgressableCmd ? ((ProgressableCmd) cmd).progress() : null;
final StringProperty textProp = cmd instanceof ProgressableCmd ? ((ProgressableCmd) cmd).textProgress() : null;
if (progProp != null) {
progProp.addListener(updateProgress);
}
if (textProp != null) {
textProp.addListener(updateTextProgress);
}
final boolean ok = cmd.doIt();
if (progProp != null) {
progProp.removeListener(updateProgress);
}
if (textProp != null) {
textProp.removeListener(updateTextProgress);
}
return ok;
}
Aggregations