cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1455277 - /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneTable.java
Date Mon, 11 Mar 2013 18:31:27 GMT
Author: aadamchik
Date: Mon Mar 11 18:31:27 2013
New Revision: 1455277

URL: http://svn.apache.org/r1455277
Log:
CAY-1720 Modeler - support tab key to navigate between fields and rows in the attribute table

intermediate patch by Ilya...
aadamchik: converted line delimiters to UNIX

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneTable.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneTable.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneTable.java?rev=1455277&r1=1455276&r2=1455277&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneTable.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneTable.java
Mon Mar 11 18:31:27 2013
@@ -40,7 +40,7 @@ import org.apache.cayenne.modeler.pref.T
 /**
  * Common superclass of tables used in Cayenne. Contains some common configuration
  * settings and utility methods.
- * 
+ *
  */
 public class CayenneTable extends JTable {
 
@@ -222,6 +222,18 @@ public class CayenneTable extends JTable
         }
     }
 
+    public void changeSelection(final int row, final int column, boolean toggle, boolean
extend) {
+        super.changeSelection(row, column, toggle, extend);
+        startCellEditingOnTabPressed(row, column);
+    }
+
+    private void startCellEditingOnTabPressed(final int row, final int column) {
+        if (isCellEditable(row, column)) {
+            this.editCellAt(row, column);
+            editorComp.requestFocus();
+        }
+    }
+
     public void sort(int column, boolean isAscend) {
         tableHeaderListener.sortByDefinedColumn(
                 convertColumnIndexToView(column),



Mime
View raw message