From 030aa07cf364f4676ca10cecf707a43254404d9e Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Tue, 3 Jul 2012 21:59:46 +0400 Subject: [PATCH] focus handling fix, improved "can insert" detection --- .../src/com/intellij/openapi/ui/ComponentWithBrowseButton.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java b/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java index 6be27c5629cd..f1f26fba8915 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java @@ -52,6 +52,8 @@ public class ComponentWithBrowseButton extends JPanel i public ComponentWithBrowseButton(Comp component, @Nullable ActionListener browseActionListener) { super(new BorderLayout(SystemInfo.isMac? 0 : 2, 0)); myComponent = component; + // required! otherwise JPanel will occasionally gain focus instead of the component + setFocusable(false); add(myComponent, BorderLayout.CENTER); myBrowseButton=new FixedSizeButton(myComponent);