use of org.adempiere.webui.event.WTableModelEvent in project adempiere by adempiere.
the class ListModelTable method setDataAt.
/**
* Set the cell value at <code>row</code> and <code>column</code>.
*
* @param aValue The value to set
* @param row the index of the row whose value is to be set
* @param col the index of the column whose value is to be set
*/
public void setDataAt(Object aValue, int row, int col) {
List<Object> vector;
WTableModelEvent tcEvent;
try {
if (getElementAt(row) instanceof List) {
vector = (List<Object>) getElementAt(row);
try {
vector.set(col, aValue);
// create a new event and fire the event
tcEvent = new WTableModelEvent(this, row, col);
fireTableChange(tcEvent);
} catch (ArrayIndexOutOfBoundsException exception) {
throw new IllegalArgumentException("Attempted to access " + "nonexistent ListModelTable column at index " + col);
}
} else {
throw new IllegalArgumentException("The ListModelTable cannot contain " + "anything other than object vectors as its row elements");
}
} catch (IndexOutOfBoundsException exception) {
throw new IllegalArgumentException("Attempted to access " + "nonexistent ListModelTable row at index " + row);
}
return;
}
use of org.adempiere.webui.event.WTableModelEvent in project adempiere by adempiere.
the class ListModelTable method sort.
/*
* (non-Javadoc)
* @see org.zkoss.zul.ListModelList#sort(java.util.Comparator, boolean)
*/
public void sort(Comparator cmpr, boolean ascending) {
if (sorter != null)
sorter.sort(cmpr, ascending);
else
Collections.sort(this.getInnerList(), cmpr);
WTableModelEvent event = new WTableModelEvent(this, WTableModelEvent.ALL_ROWS, WTableModelEvent.ALL_COLUMNS);
fireTableChange(event);
return;
}
Aggregations