cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnth...@apache.org
Subject svn commit: r1357445 - in /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor: ObjEntityAttributeTab.java dbentity/DbEntityAttributeTab.java
Date Thu, 05 Jul 2012 02:09:53 GMT
Author: johnthuss
Date: Thu Jul  5 02:09:53 2012
New Revision: 1357445

URL: http://svn.apache.org/viewvc?rev=1357445&view=rev
Log:
CAY-1677 Modeler: text fields discard input unless you press enter

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java?rev=1357445&r1=1357444&r2=1357445&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
Thu Jul  5 02:09:53 2012
@@ -45,6 +45,7 @@ import javax.swing.event.ChangeEvent;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellEditor;
 import javax.swing.table.TableColumn;
 
 import org.apache.cayenne.configuration.DataChannelDescriptor;
@@ -333,6 +334,10 @@ public class ObjEntityAttributeTab exten
     }
 
     protected void rebuildTable(ObjEntity entity) {
+        if (table.getEditingRow() != -1 && table.getEditingColumn() != -1) {
+            TableCellEditor cellEditor = table.getCellEditor(table.getEditingRow(), table.getEditingColumn());
+            cellEditor.stopCellEditing();
+        }
         ObjAttributeTableModel model = new ObjAttributeTableModel(entity, mediator, this);
         table.setModel(model);
         table.setRowHeight(25);

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java?rev=1357445&r1=1357444&r2=1357445&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java
Thu Jul  5 02:09:53 2012
@@ -30,6 +30,7 @@ import javax.swing.JToolBar;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+import javax.swing.table.TableCellEditor;
 import javax.swing.table.TableColumn;
 
 import org.apache.cayenne.configuration.DataChannelDescriptor;
@@ -241,7 +242,11 @@ public class DbEntityAttributeTab extend
     }
 
     protected void rebuildTable(DbEntity ent) {
-
+        if (table.getEditingRow() != -1 && table.getEditingColumn() != -1) {
+            TableCellEditor cellEditor = table.getCellEditor(table.getEditingRow(), table.getEditingColumn());
+            cellEditor.stopCellEditing();
+        }
+        
         DbAttributeTableModel model = new DbAttributeTableModel(ent, mediator, this);
         table.setModel(model);
         table.setRowHeight(25);



Mime
View raw message