private void showMessageIfNeeded() {
    if (myWarning != null) {
      myEditor.getScrollingModel().disableAnimation();
      myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
      myEditor.getScrollingModel().enableAnimation();

      LogicalPosition hintPosition = myCaret.getLogicalPosition();
      if (myWarningLocation != null) {
        LogicalPosition targetPosition = myEditor.offsetToLogicalPosition(myWarningLocation.getStartOffset());
        Point targetPoint = myEditor.logicalPositionToXY(targetPosition);
        if (myEditor.getScrollingModel().getVisibleArea().contains(targetPoint)) {
          hintPosition = targetPosition;
        }
      }
      LightweightHint hint = new LightweightHint(HintUtil.createInformationLabel(myWarning));
      Point p = HintManagerImpl.getHintPosition(hint, myEditor, hintPosition, HintManager.ABOVE);
      HintManagerImpl.getInstanceImpl().showEditorHint(hint, myEditor, p, 0, 0, false);
    }
  }
private void showMessageIfNeeded()