Merge branch 'master' of git@git.labs.intellij.net:idea/community
authorKirill Kalishev <kirill.kalishev@jetbrains.com>
Thu, 2 Sep 2010 09:28:04 +0000 (13:28 +0400)
committerKirill Kalishev <kirill.kalishev@jetbrains.com>
Thu, 2 Sep 2010 09:28:04 +0000 (13:28 +0400)
platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java
platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java
platform/platform-impl/src/com/intellij/ide/IdeTooltipManager.java
platform/platform-impl/src/com/intellij/ui/BalloonImpl.java

index a965e5e9d9a307a60377adf771c2548c1d71ec7d..c97fb23dbb33543ff2eb48cb1b27f5b86e88fa0f 100644 (file)
@@ -596,7 +596,7 @@ public abstract class ChooseByNameBase {
         close(false);
         return Boolean.TRUE;
       }
-    }).setFocusable(true).setRequestFocus(true).setForceHeavyweight(true).setModalContext(false);
+    }).setFocusable(true).setRequestFocus(true).setForceHeavyweight(true).setModalContext(false).setCancelOnClickOutside(false);
 
     Point point = new Point(x, y);
     SwingUtilities.convertPointToScreen(point, layeredPane);
index 1374fc23378a4bb48ddbb76390f79b8ebbb97e82..9455261fb0a438bb2295adf6e5870f76293ab2f4 100644 (file)
@@ -3965,6 +3965,12 @@ public class AbstractTreeUi {
   private void runDone(@Nullable Runnable done) {
     if (done == null) return;
 
+    if (!canInitiateNewActivity()) {
+      if (done instanceof AbstractTreeBuilder.UserRunnable) {
+        return;
+      }
+    }
+
     if (isYeildingNow()) {
       if (!myYeildingDoneRunnables.contains(done)) {
         myYeildingDoneRunnables.add(done);
index f6eda63bfb183b50f0bb7aeb3c7e701067327fec..8511ae237e0bfb194d49b4780207b97bf46d4dcd 100644 (file)
@@ -178,7 +178,7 @@ public class IdeTooltipManager implements ApplicationComponent, AWTEventListener
       .setBorderColor(border)
       .setAnimationCycle(150)
       .setShowCallout(true)
-      .setCalloutShift(0); //todo
+      .setCalloutShift(4);
     myTipLabel.setForeground(fg);
     myTipLabel.setBorder(new EmptyBorder(1, 3, 2, 3));
     myTipLabel.setFont(UIManager.getFont("ToolTip.font"));
index 5c9cfbe1b06b1d8608cb98e00a3b95f79c9eff4f..37445240a4d3f57a9fed7d9bb0d3efba385ee2b6 100644 (file)
@@ -241,6 +241,8 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
     myTracker = tracker;
     myTracker.init(this);
 
+    Position originalPreferred = position;
+
     JRootPane root = null;
     JDialog dialog = IJSwingUtilities.findParentOfType(tracker.getComponent(), JDialog.class);
     if (dialog != null) {
@@ -261,7 +263,7 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
 
     myLayeredPane.addComponentListener(myComponentListener);
 
-    myTargetPoint = myTracker.recalculateLocation(this).getPoint(myLayeredPane);
+    myTargetPoint = myPosition.getShiftedPoint(myTracker.recalculateLocation(this).getPoint(myLayeredPane), myCalloutshift);
 
 
     if (myShowPointer) {
@@ -294,6 +296,10 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
       }
     }
 
+    if (myPosition != originalPreferred) {
+      myTargetPoint = myPosition.getShiftedPoint(myTracker.recalculateLocation(this).getPoint(myLayeredPane), myCalloutshift);
+    }
+
     createComponent();
 
     myComp.validate();
@@ -329,7 +335,7 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
 
     Rectangle rec = new Rectangle(new Point(0, 0), size);
 
-    position.setRecToRelativePosition(rec, position.getShiftedPoint(myTargetPoint, myCalloutshift));
+    position.setRecToRelativePosition(rec, myTargetPoint);
 
     if (adjust) {
       rec = myPosition
@@ -375,7 +381,7 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
     RelativePoint newPosition = tracker.recalculateLocation(this);
 
     if (newPosition != null) {
-      myTargetPoint = newPosition.getPoint(myLayeredPane);
+      myTargetPoint = myPosition.getShiftedPoint(newPosition.getPoint(myLayeredPane), myCalloutshift);
       myPosition.updateBounds(this);
     }
   }
@@ -553,12 +559,10 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
                                       Rectangle forcedBounds,
                                       Dimension preferredSize,
                                       boolean showPointer,
-                                      Point targetPoint, Insets containerInsets, int calloutShift) {
+                                      Point point, Insets containerInsets, int calloutShift) {
 
       Rectangle bounds = forcedBounds;
 
-      Point point = showPointer ? getShiftedPoint(targetPoint, calloutShift) : targetPoint;
-
       if (bounds == null) {
         Point location = showPointer
                          ? getLocation(layeredPaneSize, point, preferredSize)