recover after exceptions when trying to show lookup (EA-65651, EA-65652) and fix one of them

This commit is contained in:
peter
2015-05-21 15:31:41 +02:00
parent 5bfa9f37bd
commit 56b4bcef5b
2 changed files with 10 additions and 3 deletions
@@ -654,8 +654,13 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable,
myUi = new LookupUi(this, myAdComponent, myList, myProject);
myUi.setCalculating(myCalculating);
Point p = myUi.calculatePosition().getLocation();
HintManagerImpl.getInstanceImpl().showEditorHint(this, myEditor, p, HintManager.HIDE_BY_ESCAPE | HintManager.UPDATE_BY_SCROLLING, 0, false,
HintManagerImpl.createHintHint(myEditor, p, this, HintManager.UNDER).setAwtTooltip(false));
try {
HintManagerImpl.getInstanceImpl().showEditorHint(this, myEditor, p, HintManager.HIDE_BY_ESCAPE | HintManager.UPDATE_BY_SCROLLING, 0, false,
HintManagerImpl.createHintHint(myEditor, p, this, HintManager.UNDER).setAwtTooltip(false));
}
catch (Exception e) {
LOG.error(e);
}
if (!isVisible() || !myList.isShowing()) {
hide();
@@ -1123,7 +1123,9 @@ public class AbstractPopup implements JBPopup {
mySpeedSearchPatternField = new JTextField();
if (SystemInfo.isMac) {
Font f = mySpeedSearchPatternField.getFont();
mySpeedSearchPatternField.setFont(f.deriveFont(f.getStyle(), f.getSize() - 2));
if (f != null) {
mySpeedSearchPatternField.setFont(f.deriveFont(f.getStyle(), f.getSize() - 2));
}
}
}