use of cbit.gui.ScopedExpression in project vcell by virtualcell.
the class EventAssignmentsTableModel method setValueAt.
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if (rowIndex < 0 || rowIndex >= getRowCount()) {
throw new RuntimeException("EventAssignmentsTableModel.setValueAt(), row = " + rowIndex + " out of range [" + 0 + "," + (getRowCount() - 1) + "]");
}
if (columnIndex < 0 || columnIndex >= getColumnCount()) {
throw new RuntimeException("EventAssignmentsTableModel.setValueAt(), column = " + columnIndex + " out of range [" + 0 + "," + (getColumnCount() - 1) + "]");
}
EventAssignment eventAssignment = (EventAssignment) getValueAt(rowIndex);
switch(columnIndex) {
case COLUMN_EVENTASSIGN_EXPRESSION:
{
try {
if (aValue instanceof ScopedExpression) {
throw new RuntimeException("unexpected value type ScopedExpression");
} else if (aValue instanceof String) {
Expression exp = new Expression((String) aValue);
eventAssignment.setAssignmentExpression(exp);
}
fireTableRowsUpdated(rowIndex, rowIndex);
} catch (ExpressionException e) {
e.printStackTrace(System.out);
PopupGenerator.showErrorDialog(ownerTable, "Expression error:\n" + e.getMessage());
}
break;
}
}
}
Aggregations