pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Moebius (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIVOT-471) Make TableView.getSelectedRanges() iterable
Date Mon, 26 Apr 2010 08:19:32 GMT

    [ https://issues.apache.org/jira/browse/PIVOT-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860851#action_12860851
] 

Dirk Moebius commented on PIVOT-471:
------------------------------------

Thanks for fixing this. :-)

> I did not apply the toString() patch. ListSelection is a package-private class, so only
platform code would be able to call this.

Well, previously you handed an instance of ListSelectionSequence to the caller, so he could
call toString(). ListSelectionSequence didn't implement toString() so the default Object.toString()
applied, which returned "ListSelectionSequence@34585" instead of showing the list contents.
But your fix  removed ListSelectionSequence altogether and returns ImmutableList instead,
which delegates to the toString() method of the source array, so this point is now moot.

> Make TableView.getSelectedRanges() iterable
> -------------------------------------------
>
>                 Key: PIVOT-471
>                 URL: https://issues.apache.org/jira/browse/PIVOT-471
>             Project: Pivot
>          Issue Type: Wish
>          Components: wtk
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: ListSelection_toString.patch.txt
>
>
> Iterating over the results of TableView.getSelectedRanges() is cumbersome because it
returns a Sequence<Span> which is not iterable using a for-each loop. Instead it should
return a List<Span>, which is iterable. Javadoc should state that the returned List
is immutable.
> Likewise for:
> - ListView.getSelectedRanges()
> - TreeView.getSelectedPaths()
> - FileBrowser.getSelectedFiles()
> - FileBrowserSheet.getSelectedFiles()
> JavaDoc of TableView.getSelectedRows() should clearly state that this is a convenience
method only, and that it allocates a result array on each invocation. Likewise for ListView.getSelectedItems().
> See http://mail-archives.apache.org/mod_mbox/pivot-user/201004.mbox/%3c20100419141642.10608d0zs3wp5cx4@www.premium-webmail.de%3e
for motivation of this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message