Hi there,
I have a problem with using the Glazedlist Add-On. I have a model (EMF) which create objects (kind of List objects). They are calculated and updated inside the model, but used in an EventList to present them in a table. The problem is, that I am not able to refresh the display automatically when the model changes the underlying values of the EventList. The EventList contains objects of:
[code]
public class EventListObjects implements Serializable {
private static final long serialVersionUID = 1L;
int rowIndex = 0;
Map<String, Object> columnMap = new HashMap<String, Object>();
// CustomClass itself is based on List
public EventListObjects (int rowIndex, List dataList, List columNames)[
this.rowIndex = rowIndex;
for (int i = 0; i < columnNames.size(); i++){
columnMap.put(columnMap.get(i), dataList.get(i));
}
}
public double getValue(String columnName){
return columnMap.get(columnName).get(rowIndex);
}
public void setValue(double value, String columnName){
columnMap.get(columnName).set(rowIndex, value);
}
[/code]The dataList Objects are the one containing the calculated data. When I observe the value at runtime the EventListObjects already contains the (by the model) updated value, but it is not shown in the table. Glazedlist FAQ (
http://www.glazedlists.com/documentation/faq
) tells one to do .set(.get) which works fine, but I would prefer an automatic (eventbased) refresh of the displayed data. As there is no method used in EvenListObjects class while the model changes the dataList values, I also have no idea how to implement the second recommendation of Glazedlist-FAQ because therefore I need a method which fires the events.
Hast anyone an idea if there is a way for Glazedlist to recognize a change in the underlying source?
Thanks in advance
Patric