JDK-5078552 : (coll) ChangeListener, VetoableChangeListener for Collections, Lists and others
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 1.4.2
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: x86
  • Submitted: 2004-07-26
  • Updated: 2012-10-08
  • Resolved: 2011-08-17
Related Reports
Duplicate :  
Description

Name: jl125535			Date: 07/26/2004


A DESCRIPTION OF THE REQUEST :
Currently I'm working on a project in which I show a list of JavaBeans (all the same class) in a JTable. Every row is an entry in the list and the properties are the columns. JTable has, thanks to TableModelEvent's, the ability to react on changes on the shown data. But the Collection, List and other interfaces, and their implementations, lack support to monitor and veto changes.

JUSTIFICATION :
The used workaround is very slow and I think this function is easy to implement, would speed up some applications. Also the footprint, when there are no registered listeners, is minimal.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I'd like to have change and vetoable listeners for the data of Collection's, List's, Set's and others.

CUSTOMER SUBMITTED WORKAROUND :
My current workaround is to have a wrapper class for all interfaces, which create these events.
(Incident Review ID: 217999) 
======================================================================

Comments
EVALUATION One of the design criteria for Collections was simplicity, so adding observability to the collections API does not seem to be in the spirit of the original design. One can create ObservableList, extending List, outside of the Collections Framework, while delegating to the real classes to avoid reimplementing everything. ###@###.### 2004-07-26
26-07-2004