FilteredList/SortedList

Richard Bair richard.bair at oracle.com
Tue Jan 8 14:47:44 PST 2013


>> 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 thing?



More information about the openjfx-dev mailing list