Java 类com.intellij.ui.BalloonImpl 实例源码

项目:intellij-ce-playground    文件:BalloonPopupBuilderImpl.java   
@NotNull
@Override
public Balloon createBalloon() {
  final BalloonImpl result = new BalloonImpl(
    myContent, myBorder, myBorderInsets, myFill, myHideOnMouseOutside, myHideOnKeyOutside, myHideOnAction, myShowCallout, myCloseButtonEnabled,
    myFadeoutTime, myHideOnFrameResize, myHideOnLinkClick, myClickHandler, myCloseOnClick, myAnimationCycle, myCalloutShift,
    myPositionChangeXShift, myPositionChangeYShift, myDialogMode, myTitle, myContentInsets, myShadow, mySmallVariant, myBlockClicks,
    myLayer);

  if (myStorage != null && myAnchor != null) {
    List<Balloon> balloons = myStorage.get(myAnchor);
    if (balloons == null) {
      myStorage.put(myAnchor, balloons = new ArrayList<Balloon>());
      Disposer.register(myAnchor, new Disposable() {
        @Override
        public void dispose() {
          List<Balloon> toDispose = myStorage.remove(myAnchor);
          if (toDispose != null) {
            for (Balloon balloon : toDispose) {
              if (!balloon.isDisposed()) {
                Disposer.dispose(balloon);
              }
            }
          }
        }
      });
    }
    balloons.add(result);
    result.addListener(new JBPopupAdapter() {
      @Override
      public void onClosed(LightweightWindowEvent event) {
        if (!result.isDisposed()) {
          Disposer.dispose(result);
        }
      }
    });
  }

  return result;
}
项目:tools-idea    文件:BalloonPopupBuilderImpl.java   
@NotNull
public Balloon createBalloon() {
  final BalloonImpl result =
    new BalloonImpl(myContent, myBorder, myFill, myHideOnMouseOutside, myHideOnKeyOutside, myHideOnAction, myShowCalllout,
                    myCloseButtonEnabled, myFadeoutTime, myHideOnFrameResize, myClickHandler, myCloseOnClick, myAnimationCycle,
                    myCalloutShift, myPositionChangeXShift, myPositionChangeYShift, myDialogMode, myTitle, myContentInsets, myShadow,
                    mySmallVariant, myBlockClicks, myLayer);
  if (myAnchor != null) {
    List<Balloon> balloons = myStorage.get(myAnchor);
    if (balloons == null) {
      myStorage.put(myAnchor, balloons = new ArrayList<Balloon>());
      Disposer.register(myAnchor, new Disposable() {
        @Override
        public void dispose() {
          List<Balloon> toDispose = myStorage.remove(myAnchor);
          if (toDispose != null) {
            for (Balloon balloon : toDispose) {
              if (!balloon.isDisposed()) {
                Disposer.dispose(balloon);
              }
            }
          }
        }
      });
    }
    balloons.add(result);
    result.addListener(new JBPopupAdapter() {
      @Override
      public void onClosed(LightweightWindowEvent event) {
        if (!result.isDisposed()) {
          Disposer.dispose(result);
        }
        myStorage.remove(result);
      }
    });
  }
  return result;
}
项目:tools-idea    文件:CheckRegExpForm.java   
private void updateBalloon() {
  boolean correct = false;
  try {
    correct = Pattern.compile(myRegExp.getText()).matcher(mySampleText.getText()).matches();
  } catch (Exception ignore) {}

  mySampleText.setBackground(correct ? new JBColor(new Color(231, 250, 219), new Color(68, 85, 66)) : new JBColor(new Color(255, 177, 160), new Color(110, 43, 40)));
  BalloonImpl balloon = (BalloonImpl)myRef.get();
  if (balloon != null && balloon.isDisposed()) {
    balloon.revalidate();
  }
}
项目:consulo    文件:BalloonPopupBuilderImpl.java   
@Nonnull
@Override
public Balloon createBalloon() {
  final BalloonImpl result =
          new BalloonImpl(myContent, myBorder, myBorderInsets, myFill, myHideOnMouseOutside, myHideOnKeyOutside, myHideOnAction, myHideOnCloseClick,
                          myShowCallout, myCloseButtonEnabled, myFadeoutTime, myHideOnFrameResize, myHideOnLinkClick, myClickHandler, myCloseOnClick,
                          myAnimationCycle, myCalloutShift, myPositionChangeXShift, myPositionChangeYShift, myDialogMode, myTitle, myContentInsets, myShadow,
                          mySmallVariant, myBlockClicks, myLayer, myRequestFocus, myPointerSize, myCornerToPointerDistance);

  if (myStorage != null && myAnchor != null) {
    List<Balloon> balloons = myStorage.get(myAnchor);
    if (balloons == null) {
      myStorage.put(myAnchor, balloons = new ArrayList<>());
      Disposer.register(myAnchor, new Disposable() {
        @Override
        public void dispose() {
          List<Balloon> toDispose = myStorage.remove(myAnchor);
          if (toDispose != null) {
            for (Balloon balloon : toDispose) {
              if (!balloon.isDisposed()) {
                Disposer.dispose(balloon);
              }
            }
          }
        }
      });
    }
    balloons.add(result);
    result.addListener(new JBPopupAdapter() {
      @Override
      public void onClosed(LightweightWindowEvent event) {
        if (!result.isDisposed()) {
          Disposer.dispose(result);
        }
      }
    });
  }

  return result;
}