[Schmitzm-commits] r2148 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 28 17:28:28 CET 2012


Author: mojays
Date: 2012-11-28 17:28:28 +0100 (Wed, 28 Nov 2012)
New Revision: 2148

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/TablePopupMenuListener.java
Log:
TablePopupMenuListener: also set selected column on popup trigger

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/TablePopupMenuListener.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/TablePopupMenuListener.java	2012-11-28 15:39:47 UTC (rev 2147)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/TablePopupMenuListener.java	2012-11-28 16:28:28 UTC (rev 2148)
@@ -66,8 +66,13 @@
     // automatisch auf die geklickte Zeile einstellen
     if ( e.isPopupTrigger() && table.getSelectedRowCount() <= 1 ) {
       int row = table.rowAtPoint(e.getPoint());
+      int col = table.columnAtPoint(e.getPoint());
+//      if ( row >= 0 )
+//        table.getSelectionModel().setSelectionInterval(row, row);
       if ( row >= 0 )
-        table.getSelectionModel().setSelectionInterval(row, row);
+        table.setRowSelectionInterval(row, row);
+      if ( col >= 0 )
+        table.setColumnSelectionInterval(col, col);
     }
   }
 }



More information about the Schmitzm-commits mailing list