Review request for 7124393: [macosx] JCheckBox in JTable: checkbox doesn't alaways respond to the first mouse click (original) (raw)

Alexander Potochkin Alexander.Potochkin at oracle.com
Thu Jan 26 09:02:35 PST 2012


Hello Anthony

Hi Alex,

I'm OK with realSync() calls, but unsure about the stopCellEditing() call. Indeed, using a Swing method should produce correct results. However, I think that this regression test is supposed to emulate user's actions, not Swing calls, isn't it? If so, we should either find a cross-platform events that finish editing and use Robot to emulate them, or use the "os.name" property and synthesize different user actions on different platforms. Please correct me if my assumption is wrong.

Your assumption is correct it is indeed better to always emulate the user's action.

However in this case it is not as simple because Aqua LaF doesn't provide a key shortcut which stops the cell editing see BasicLookAndFeel line 1545, F2 is bound to "startEditing" action (it calls stopEditing() method) there is no such an action bound to any key in
AquaKeyBinding.getTableInputMap()

So calling stopCellEditing inside the test is a good tradeoff because it is simple, makes the test compatible with every LaF and doesn't interfere with what the *bug6711682 *actually tests

Thanks alexp

-- best regards, Anthony On 1/23/2012 9:33 PM, Alexander Potochkin wrote: Hello

Please review the following fix: http://cr.openjdk.java.net/~alexp/7124393/webrev.00/ the bug's description is here: http://bugs.sun.com/bugdatabase/viewbug.do?bugid=7124393 The bug is in the test, F2 doesn't stop editing on MacOS, we should not use the keyboard to commit the data the test is also updated to access the Swing methods on the Event Dispatching Thread only Thanks alexp



More information about the macosx-port-dev mailing list