Tree: detect tree cell editor in FlatUIUtils.isCellEditor()

This commit is contained in:
Karl Tauber
2024-02-19 22:12:29 +01:00
parent 2972300112
commit 625c0a3321

View File

@@ -60,6 +60,7 @@ import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.tree.DefaultTreeCellEditor;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatIntelliJLaf;
import com.formdev.flatlaf.FlatLaf;
@@ -304,6 +305,10 @@ public class FlatUIUtils
if( parent instanceof JTable && ((JTable)parent).getEditorComponent() == c )
return true;
// check whether used as tree cell editor
if( parent instanceof DefaultTreeCellEditor.EditorContainer )
return true;
// check whether used as cell editor
// Table.editor is set in JTable.GenericEditor constructor
// Tree.cellEditor is set in sun.swing.FilePane.editFileName()