Author: echatellier Date: 2009-10-15 11:08:47 +0200 (Thu, 15 Oct 2009) New Revision: 2676 Modified: trunk/changelog.txt trunk/src/main/java/org/chorem/jtimer/JTimer.java Log: Force task selection on rigth clic Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2009-10-09 14:24:11 UTC (rev 2675) +++ trunk/changelog.txt 2009-10-15 09:08:47 UTC (rev 2676) @@ -3,6 +3,7 @@ jTimer (1.3.1) stable; urgency=low + * Force task selection on rigth clic * Fix duration edition (task and alerts) * Fix NPE related to non available systray * JNA version bump : 3.2.3 Modified: trunk/src/main/java/org/chorem/jtimer/JTimer.java =================================================================== --- trunk/src/main/java/org/chorem/jtimer/JTimer.java 2009-10-09 14:24:11 UTC (rev 2675) +++ trunk/src/main/java/org/chorem/jtimer/JTimer.java 2009-10-15 09:08:47 UTC (rev 2676) @@ -44,6 +44,7 @@ import javax.swing.ListSelectionModel; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.TreePath; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -1256,6 +1257,11 @@ // gestion du clic droit case MouseEvent.BUTTON3: + // force task selection on rigth clic + TreePath path = projectsAndTasksTable.getPathForLocation(e.getX(), e.getY()); + int selectedRow = projectsAndTasksTable.getRowForPath(path); + projectsAndTasksTable.getSelectionModel().setSelectionInterval(selectedRow, selectedRow); + // fix item selection JPopupMenu menu = new JPopupMenu();