8000 TableColumn<T, S?>.converter function doesn't accept non-null-typed columns · Issue #46 · edvin/tornadofx2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
TableColumn<T, S?>.converter function doesn't accept non-null-typed columns #46
Open
@aleksandar-stefanovic

Description

@aleksandar-stefanovic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0