Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableColumn<T, S?>.converter function doesn't accept non-null-typed columns #46

Open
aleksandar-stefanovic opened this issue Jan 29, 2022 · 0 comments

Comments

@aleksandar-stefanovic
Copy link

The code at question is at TableView.kt, around line ~148:

fun <T, S> TableColumn<T, S?>.converter(converter: StringConverter<in S>): TableColumn<T, S?> = apply {
    cellFormat(FX.defaultScope) { text = converter.toString(it) }
}

It requires that the S type parameter is null, so the following code doesn't work:

column("Column name", MyObject::myNonNullProperty).converter(MyCustomTypeConverter)

The fix would be to remove question marks from the S type parameter, so that it can resolve to both null and non-null types, i.e. it doesn't break the API, just makes it available, in addition, to non-null types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant