wide selection in trees under aqua laf + deferred icon tree cache invalidation fix...
[idea/community.git] / platform / platform-api / src / com / intellij / ui / treeStructure / Tree.java
index cc20898b9ef956fd6b37b8dcf225a8ebb8841933..fbd40f0cd46cc4d43453a7ad7d001b87afcdba0d 100644 (file)
@@ -80,6 +80,20 @@ public class Tree extends JTree implements ComponentWithEmptyText, Autoscroll, Q
     setCellRenderer(new NodeRenderer());
   }
 
+  @Override
+  public void setUI(final TreeUI ui) {
+    TreeUI actualUI = ui;
+    if (SystemInfo.isMac && !isCustomUI() && UIUtil.isUnderAquaLookAndFeel() && !(ui instanceof UIUtil.MacTreeUI)) {
+      actualUI = new UIUtil.MacTreeUI();
+    }
+
+    super.setUI(actualUI);
+  }
+
+  protected boolean isCustomUI() {
+    return false;
+  }
+
   public String getEmptyText() {
     return myEmptyTextHelper.getEmptyText();
   }