<div dir="ltr"><div>Hi,</div><div><br></div><div>TableView data usually comes from a database and is mapped to java objects (I don't have actual statistics on this but it's probably a true assertion).</div><div>It Would be very useful if we could just copy database mapped objects to javafx observables and say: Display it on a tableview.</div><div>Configuration of each column would be done as an annotation, like this:</div><div><br></div><div><div style="background-color:rgb(30,31,34);color:rgb(206,208,214);font-family:"JetBrains Mono",monospace"><pre><span style="color:rgb(116,157,237)">public class </span>EmployeeObservable {<br>    @Column(<span style="color:rgb(177,137,245)">label </span>= <span style="color:rgb(126,196,130)">"Registration"</span>, <span style="color:rgb(177,137,245)">style </span>= <span style="color:rgb(126,196,130)">"-fx-alignment: right"</span>)<br>    <span style="color:rgb(116,157,237)">private </span>IntegerProperty <span style="color:rgb(114,207,214)">registration </span>= <span style="color:rgb(116,157,237)">new </span>SimpleIntegerProperty();<br><br>    @Column(<span style="color:rgb(177,137,245)">label </span>= <span style="color:rgb(126,196,130)">"Name"</span>)<br>    <span style="color:rgb(116,157,237)">private </span>StringProperty <span style="color:rgb(114,207,214)">name </span>= <span style="color:rgb(116,157,237)">new </span>SimpleStringProperty();<br><br>    @Column(<span style="color:rgb(177,137,245)">label </span>= <span style="color:rgb(126,196,130)">"Salary"</span>, converter = BigDecimalCurrencyConverter.<span style="color:rgb(116,157,237)">class</span>)<br>    <span style="color:rgb(116,157,237)">private </span>ObjectProperty<BigDecimal> <span style="color:rgb(114,207,214)">salary </span>= <span style="color:rgb(116,157,237)">new </span>SimpleObjectProperty<>();<br><br>    <span style="color:rgb(111,115,122)">//boilerplate here<br></span>}</pre></div></div><div><br></div><div>Other annotation options:</div><div><div style="background-color:rgb(30,31,34);color:rgb(206,208,214);font-family:"JetBrains Mono",monospace"><pre>@Column(<span style="color:rgb(177,137,245)">ignore </span>= <span style="color:rgb(116,157,237)">true</span>)<br><br>@Column(graphicsConverter = CheckBoxGraphicsConverter.<span style="color:rgb(116,157,237)">class</span>)</pre></div></div><div>And to apply it:</div><div><div style="background-color:rgb(30,31,34);color:rgb(206,208,214);font-family:"JetBrains Mono",monospace"><pre>TableViewBuilder<EmployeeObservable> <span style="color:rgb(114,207,214)">builder </span>= <span style="color:rgb(116,157,237)">new </span>TableViewBuilder<>(tableView, EmployeeObservable.<span style="color:rgb(116,157,237)">class</span>);<br>builder.build();</pre></div></div><div><br></div><div>I actually have implemented this and it's very useful. I can't share it because I've done it for a private company, but it's easy to re-do it.</div><div><br></div><div>I'm not sure if it would go in a general purpose toolkit, but I thought it would be nice to share (the idea). <br></div><div><br></div><div>-- Thiago.<br></div><div><br></div></div>