java.whoover at gmail.com
Wed Jan 9 04:32:07 PST 2013
+1 for filter/sort added to java.util.List in Java 8
I feel as though filtering/sorting is a container management issue. The work
that has been done on the ObservableXXX (and their subsidiaries) in JavaFX
has been excellent, but they all seem to be addressing an issue that is
really outside the scope of JavaFX, no?
That's my 2 cents (if it's even worth that much :)
From: openjfx-dev-bounces at openjdk.java.net
[mailto:openjfx-dev-bounces at openjdk.java.net] On Behalf Of Richard Bair
Sent: Tuesday, January 08, 2013 5:48 PM
To: Martin Sladecek
Cc: openjfx-dev at openjdk.java.net
Subject: Re: FilteredList/SortedList
>> TransformationList is not modifiable. We had a big discussion about this
(together with Micheal Heinrichs) about 2 years ago a decided we have to
make all TransformationList subclasses unmodifiable as otherwise it would
break the List contract. We'd have to have special implementation of sort
for the WrappedList.
> Oh dear. That is a problem!
I'd like a little more detail on this:
- If the user attempts to add a row to a TransformationList or
remove a row from the TransformationList or move rows on the
TransformationList, you propose to throw an unmodifiable exception?
- Note this impacts TableView, ListView, TreeView, and
TreeTableView. Drag and drop cannot work (well) if a transformation list is
used by any of these views (since they will not be able to drop items into
the list in any case) -- at least, not out of the box. Developers will have
to always manage this by hand.
- If the user adds an item to the source list, is the transformation
list automatically updated?
- If the state on an item changes that was used in the
transformation list predicate / comparator for filtering / sorting, is the
filter / sort recalculated?
- If my filter is based on criteria which changes (such as text in a
TextBox), can I update the TransformedList or does it have to be replaced?
That is, are the filter criteria / sort criteria state on the
TransformationList that can be modified?
It seems odd that basic filter / sort functionality is not something being
added to java.util.List in Java 8. Are they not planning on doing any such
More information about the openjfx-dev