You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In scala.swing.Table the default editor behaviour differs from the expected. The TableModel interface contains the method getColumnClass which I expected to be used to determine the type of a column in order to select the right cell editor. Instead the code looks at the value in the cell and if it is null the default editor for Object is used.
// TODO: a public API for setting editors
protected def editor(row: Int, column: Int) = {
val v = apply(row, column).asInstanceOf[AnyRef]
if (v != null)
Table.this.peer.getDefaultEditor(v.getClass)
else
Table.this.peer.getDefaultEditor(classOf[Object])
Use case where this breaks: I have a date column in a table which might be null. When null I cannot enter a valid date since the wrong editor is used.
In scala.swing.Table the default editor behaviour differs from the expected. The TableModel interface contains the method
getColumnClass
which I expected to be used to determine the type of a column in order to select the right cell editor. Instead the code looks at the value in the cell and if it isnull
the default editor forObject
is used.Use case where this breaks: I have a date column in a table which might be null. When null I cannot enter a valid date since the wrong editor is used.
This is how I expected the code to look:
The text was updated successfully, but these errors were encountered: