Update of /cvsroot/squirrel-sql/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32291
Modified Files:
DataTypeString.java
Log Message:
strings containing newlines can only be edited in multi-line popup, not in cell
Index: DataTypeString.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeString.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** DataTypeString.java 25 Feb 2004 13:43:48 -0000 1.15
--- DataTypeString.java 6 Apr 2004 20:01:06 -0000 1.16
***************
*** 132,139 ****
/**
* This Data Type can be edited in a table cell.
*/
public boolean isEditableInCell(Object originalValue) {
! return true;
!
}
--- 132,149 ----
/**
* This Data Type can be edited in a table cell.
+ * <P>
+ * If the data includes newlines, the user must not be allowed to edit it
+ * in the cell because the CellEditor uses a JTextField which filters out newlines.
+ * If we try to use anything other than a JTextField, or use a JTextField with no
+ * newline filtering, the text is not visible in the cell, so the user cannot even read
+ * the text, much less edit it. The simplest solution is to allow editing of multi-line
+ * text only in the Popup window.
*/
public boolean isEditableInCell(Object originalValue) {
! // prevent editing if text contains newlines
! if (originalValue != null && ((String)originalValue).indexOf('\n') > -1)
! return false;
! else return true;
!
}
|