Atom Feed SITE FEED   ADD TO GOOGLE READER

Seeking feedback: ListEvent, ListEventBuilder APIs

As of today, beansbinding does a very lightweight approach to observable lists. There's two interfaces, ObservableList.java and ObservableListListener.java.

I'm refining a proposal for a more heavyweight approach. In addition to simplified List and Listener interfaces, I add a ListEvent interface and a ListEventBuilder class.

Motivation for these interfaces:
  • Support for fine-grained events. Now List.removeAll can fire a single event.
  • Support for move events. This allows listeners to track state as elements are reordered or sorted by the user.
  • Support for event 'envelopes'. This allows the user of an ObservableList to prevent observers from seeing intermediate states.

    Fine-grained events are a central part of the well-loved Glazed Lists project, and I think they could be very helpful in the JDK.

    If you could read through this code and email me your comments, I'd appreciate it:
    ListEvent
    ListEventBuilder