Table: do not select text in cell editor when it gets focus (when JTable.surrendersFocusOnKeystroke is true) and TextComponent.selectAllOnFocusPolicy is once (the default) or always (issue #395)

This commit is contained in:
Karl Tauber
2021-10-16 23:32:08 +02:00
parent 65a4f66d2c
commit f8b9f4c1fa
4 changed files with 43 additions and 16 deletions

View File

@@ -108,7 +108,7 @@ public class FlatCaret
protected void selectAllOnFocusGained() {
JTextComponent c = getComponent();
Document doc = c.getDocument();
if( doc == null || !c.isEnabled() || !c.isEditable() )
if( doc == null || !c.isEnabled() || !c.isEditable() || FlatUIUtils.isCellEditor( c ) )
return;
Object selectAllOnFocusPolicy = c.getClientProperty( SELECT_ALL_ON_FOCUS_POLICY );