GlazedLists Vaadin Container
Containers made easy: A Container implementation backed by GlazedLists
This is a Container implementation for Vaadin that is backed by a GlazedLists' (www.glazedlists.com) EventList.
This makes your life great in several ways:
- It's easy to use.
- GlazedLists can do a bunch of really powerful transformations on data lists.
- It supports Server Push (introduced in Vaadin 7.1), so all your data changes push to the client without any extra work from you (threading is taken care of).
- Sorting, filtering and editing are fully supported.
- Work with your domain objects (POJOs) rather than having to use Items and Properties all the time (though Property and Item are provided by the container so binding and such still works).
Requires Java 8.
Sample code
public class MyTest extends HorizontalLayout { public MyTest() { // Put objects into the base list. You can do all sorts of transformations // on this using standard GlazedLists list implementations EventList<Person> data = GlazedLists.eventListOf( new Person( "Rob", "Eden", 37 ), new Person( "Joe", "Somebody", 25 ), new Person( "Fred", "Whoever", 64 ) ); // PropertyHandlers define hot to convert betwen your POJOs and properties. // BeanPropertyHandler uses JavaBeans PropertyHandler<Person> handler = new BeanPropertyHandler( Person.class, Object.class ); // Create the container Container container = EventListContainer.create( data, handler, UI.getCurrent() ).build(); Table table = new Table( "People", container ); addComponent( table ); } class Person { private String firstName; private String lastName; private int age; Person( String firstName, String lastName, int age ) { this.firstName = firstName; this.lastName = lastName; this.age = age; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public int getAge() { return age; } } }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
The 1.3.x version branch supports Vaadin 8 using the version 7 compatibility libraries. Use this version if you are still using the compatibility APIs.
- Released
- 2017-11-30
- Maturity
- STABLE
- License
- BSD 2-clause "Simplified" License
Compatibility
- Framework
- Vaadin 7.7+
- Vaadin 8.0+
- Vaadin 7.4+ in 1.2.9
- Vaadin 7.1+ in 1.0.7
- Browser
- Browser Independent
GlazedLists Vaadin Container - Vaadin Add-on Directory
Containers made easy: A Container implementation backed by GlazedListsIssue Tracker
Source Code
Javadocs
GlazedLists Vaadin Container version 1.0.1
Initial public release
GlazedLists Vaadin Container version 1.0.2
Add ability to get to source object from Item instance (EventListContainer.getSourceObject(Item))
GlazedLists Vaadin Container version 1.0.3
Some locking fixes
GlazedLists Vaadin Container version 1.0.5
Another lock fix when the source is changed.
GlazedLists Vaadin Container version 1.0.6
Another locking fix when changing source lists.
GlazedLists Vaadin Container version 1.0.7
Handle UIDetachedException and automatically dispose the container.
GlazedLists Vaadin Container version 1.1.0
* API break: Containers are now built using a builder pattern. See EventListContainer.create(...)
* Better ItemSetChange events to support smarter handling by Grid (and, in theory, Table)
* A number performance improvements
GlazedLists Vaadin Container version 1.2.0
Generation of Item IDs has changed to be more correct. Previously the list index was used, but this caused problems with removing or adding items places other than the end of the source list. To rectify this, the following methods have been added to the builder:
idFunction( Function
GlazedLists Vaadin Container version 1.2.1
Prevent usage after disposal.
GlazedLists Vaadin Container version 1.2.4
(Changes from since 1.2.1)
- New BeanPropertyHandler for easy handling of JavaBeans
- New "idIsObject" method on Builder to use the POJO as the item ID
- A number of bug and performance improvements
GlazedLists Vaadin Container version 1.2.6
(Changes since 1.2.1)
- New BeanPropertyHandler for easy handling of JavaBeans
- New "idIsObject" method on Builder to use the POJO as the item ID
- A number of bug and performance improvements
- A getTransformedSource() method
- Fix for issue #2: ensure source list is "kicked" when values are updated
GlazedLists Vaadin Container version 1.2.7
Fixes a bug where old values in events are not know (with GroupingList, for example)
GlazedLists Vaadin Container version 1.2.8
Fixes an issue where an exception would be thrown if "getItemIds" was called with too many items requested.
GlazedLists Vaadin Container version 1.2.9
Fixes an issue with StringFieldFilterListener where it was only listening for TextChange events and not ValueChange events.
GlazedLists Vaadin Container version 1.3.0
The 1.3.x version branch supports Vaadin 8 using the version 7 compatibility libraries. Use this version if you are still using the compatibility APIs.