You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Edvin Syse (JIRA)" <ji...@apache.org> on 2011/07/13 22:43:59 UTC

[jira] [Updated] (PIVOT-770) Parameterize ListView, TableView and TreeView getters and setters for ListData

     [ https://issues.apache.org/jira/browse/PIVOT-770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Edvin Syse updated PIVOT-770:
-----------------------------

    Attachment: Parameterize-GetAndSetListData.patch

The pach also touches some other files that did casts that are no longer valid/necessary. I have not run any tests, as I'm not yet familiar with the testing procedures of Pivot.

> Parameterize ListView, TableView and TreeView getters and setters for ListData
> ------------------------------------------------------------------------------
>
>                 Key: PIVOT-770
>                 URL: https://issues.apache.org/jira/browse/PIVOT-770
>             Project: Pivot
>          Issue Type: Improvement
>    Affects Versions: 2.0
>            Reporter: Edvin Syse
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Parameterize-GetAndSetListData.patch
>
>
> Firstly, please forgive me if I use incorrect terms, I'm no generics expert :)
> I'll use TableView#getTableData() as an example. This method is today anonymously typed, so that if you want to mutate the list, you need to cast it to a spesific type first. This can easily be fixed by parameterizing the method. The same goes for ListView and TreeView as well. I'll supply a patch to change this behavior. This removes an annoyance and enables better looking code.
> This is how one need to do it today:
> List<MyObject> myList = (List<MyObject>) tableView.getTableData();
> myList.add(myObject);
> By parameterizing the methods, this changes to:
> tableView.getTableData().add(myObject);

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira