Author: mallon Date: 2012-07-13 13:54:39 +0200 (Fri, 13 Jul 2012) New Revision: 3525 Url: http://chorem.org/repositories/revision/lima/3525 Log: fixes #651 Correction sur la table, afin d empecher le retour en debut de tableau lorsque la derniere ligne est selectionnee et que la touche entree est utilisee pour passer a la ligne suivante. Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java trunk/lima-swing/src/main/resources/log4j.properties Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2012-07-13 11:01:02 UTC (rev 3524) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2012-07-13 11:54:39 UTC (rev 3525) @@ -26,6 +26,8 @@ package org.chorem.lima.ui.financialtransaction; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; @@ -67,6 +69,8 @@ /** serialVersionUID. */ private static final long serialVersionUID = 3133690382049594727L; + private static final Log log = LogFactory.getLog(FinancialTransactionTable.class); + protected FinancialTransactionViewHandler handler; private int x_tab; @@ -146,11 +150,24 @@ private class MyKeyAdapter extends KeyAdapter { + FinancialTransactionTable table = FinancialTransactionTable.this; + @Override public void keyPressed(KeyEvent e) { final FinancialTransactionViewHandler handler = getHandler(); + /*Allow to block access to the first row when touch enter pressed, if selection on + * last row*/ + if (e.getKeyCode() == KeyEvent.VK_ENTER){ + int selectedRow = table.getSelectedRow()+1; + if(selectedRow != table.getRowCount()){ + table.setRowSelectionInterval(table.getSelectedRow(), table.getSelectedRow()); + } else { + table.setRowSelectionInterval(table.getSelectedRow()-1, table.getSelectedRow()-1); + } + } + // delete selected row with the key : delete or ctrl + clear // ou de l'entree if (e.getKeyCode() == KeyEvent.VK_DELETE Modified: trunk/lima-swing/src/main/resources/log4j.properties =================================================================== --- trunk/lima-swing/src/main/resources/log4j.properties 2012-07-13 11:01:02 UTC (rev 3524) +++ trunk/lima-swing/src/main/resources/log4j.properties 2012-07-13 11:54:39 UTC (rev 3525) @@ -38,3 +38,4 @@ # package level log4j.logger.org.chorem.lima=INFO +log4j.logger.org.chorem.lima.ui.financialtransaction.FinancialTransactionTable=DEBUG