-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EasyBind.concat(List<ObservableList<T>>) #8
base: master
Are you sure you want to change the base?
Conversation
Creates a new list that combines the values of the given lists. Unlike FXCollections.concat(), updates to the source lists propagate to the combined list.
Thanks for the PR! OMG, I didn't expect I can see how your implementation would fail on concat(list, list); Some tests would be nice. |
I added some tests, hope they're ok. Otherwise let me know. I also added a short test for |
You did not test that the published change events are correct. |
Just as an idea, wouldn't it be better (for boilersplate's sake) to switch out the Second (for performance sake), would it be an idea to cage the overal size? As it can be detected when the underlaying lists are changing, it would easy to refresh/recalculate the overal size (or at least set a flag that the current size is invalid), whichever way is prefered. |
* Add EasyBind.concat(List<ObservableList<T>>) Creates a new list that combines the values of the given lists. Unlike FXCollections.concat(), updates to the source lists propagate to the combined list. * Fix compiler errors * add some tests for concatenating lists * Fix bugs in the ConcatList implementation * Duplicated List values will break the implementation's change events * Added better tests that test different combinations. This commit closes comments in #8. * Add .idea to .gitignore, clean up test case * Added support for an "ObservableList" input * Adds an ObservableList input * Tracks changes to the List, firing changes if the 2D list changes, this eases up the work when bigger changes happen * Change `concat` -> `flattenList`, it's a flatten operation after all * Rename flatten to concat Co-authored-by: maul.esel <[email protected]> Co-authored-by: Kevin Brightwell <[email protected]>
Since this project sadly doesn't seem to be active any more #16, I've created a fork and continued development there: https://github.com/tobiasdiez/EasyBind. I liked your changes in this PR, and thus included them in the forked repo. Hope this is OK for you. |
Creates a new list that combines the values of the given lists. Unlike
FXCollections.concat()
, updates to the source lists propagate to the combined list.I needed this for a project of mine, so I hacked it together. Since it might be useful to others as well, I thought I'd submit it here. If there are any changes you'd like me to make, let me know.