use of org.terasology.gestalt.naming.Version in project Terasology by MovingBlocks.
the class ModuleDetailsScreen method setUpUpdateModuleButton.
private void setUpUpdateModuleButton() {
updateModuleButton.bindEnabled(new ReadOnlyBinding<Boolean>() {
@Override
public Boolean get() {
final String online = onlineVersion.getText();
final String installed = installedVersion.getText();
if (StringUtils.isNotBlank(online) && StringUtils.isNotBlank(installed)) {
return new Version(online).compareTo(new Version(installed)) > 0;
}
return false;
}
});
updateModuleButton.subscribe((button -> {
if (dependencyInfoBinding.get() != null) {
startDownloadingNewestModulesRequiredFor(dependencyInfoBinding.get());
}
}));
}
Aggregations