Java Code Examples for com.intellij.openapi.ui.popup.BalloonBuilder#setAnimationCycle()

The following examples show how to use com.intellij.openapi.ui.popup.BalloonBuilder#setAnimationCycle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LivePreview.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void showBalloon(Editor editor, String replacementPreviewText) {
  if (ApplicationManager.getApplication().isUnitTestMode()) {
    myReplacementPreviewText = replacementPreviewText;
    return;
  }

  ReplacementView replacementView = new ReplacementView(replacementPreviewText);

  BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(replacementView);
  balloonBuilder.setFadeoutTime(0);
  balloonBuilder.setFillColor(IdeTooltipManager.GRAPHITE_COLOR);
  balloonBuilder.setAnimationCycle(0);
  balloonBuilder.setHideOnClickOutside(false);
  balloonBuilder.setHideOnKeyOutside(false);
  balloonBuilder.setHideOnAction(false);
  balloonBuilder.setCloseButtonEnabled(true);
  myReplacementBalloon = balloonBuilder.createBalloon();
  EditorUtil.disposeWithEditor(editor, myReplacementBalloon);
  myReplacementBalloon.show(new ReplacementBalloonPositionTracker(editor), Balloon.Position.below);
}
 
Example 2
Source File: PropertyEditorPanel.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Balloon showPopupHelper(
  InspectorGroupManagerService inspectorService,
  Project project,
  @Nullable DiagnosticsNode node,
  @NotNull InspectorService.Location location,
  FlutterDartAnalysisServer service
) {
  final Color GRAPHITE_COLOR = new JBColor(new Color(236, 236, 236, 215), new Color(60, 63, 65, 215));

  final Disposable panelDisposable = Disposer.newDisposable();
  final PropertyEditorPanel panel =
    new PropertyEditorPanel(inspectorService, project, service, true, true, panelDisposable);

  final StableWidgetTracker tracker = new StableWidgetTracker(location, service, project, panelDisposable);

  final EventStream<VirtualFile> activeFile = new EventStream<>(location.getFile());
  panel.initalize(node, tracker.getCurrentOutlines(), activeFile);

  panel.setBackground(GRAPHITE_COLOR);
  panel.setOpaque(false);
  final BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(panel);
  balloonBuilder.setFadeoutTime(0);
  balloonBuilder.setFillColor(GRAPHITE_COLOR);
  balloonBuilder.setAnimationCycle(0);
  balloonBuilder.setHideOnClickOutside(true);
  balloonBuilder.setHideOnKeyOutside(false);
  balloonBuilder.setHideOnAction(false);
  balloonBuilder.setCloseButtonEnabled(false);
  balloonBuilder.setBlockClicksThroughBalloon(true);
  balloonBuilder.setRequestFocus(true);
  balloonBuilder.setShadow(true);
  final Balloon balloon = balloonBuilder.createBalloon();
  Disposer.register(balloon, panelDisposable);

  return balloon;
}
 
Example 3
Source File: PropertyEditorPanel.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Balloon showPopupHelper(
  InspectorGroupManagerService inspectorService,
  Project project,
  @Nullable DiagnosticsNode node,
  @NotNull InspectorService.Location location,
  FlutterDartAnalysisServer service
) {
  final Color GRAPHITE_COLOR = new JBColor(new Color(236, 236, 236, 215), new Color(60, 63, 65, 215));

  final Disposable panelDisposable = Disposer.newDisposable();
  final PropertyEditorPanel panel =
    new PropertyEditorPanel(inspectorService, project, service, true, true, panelDisposable);

  final StableWidgetTracker tracker = new StableWidgetTracker(location, service, project, panelDisposable);

  final EventStream<VirtualFile> activeFile = new EventStream<>(location.getFile());
  panel.initalize(node, tracker.getCurrentOutlines(), activeFile);

  panel.setBackground(GRAPHITE_COLOR);
  panel.setOpaque(false);
  final BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(panel);
  balloonBuilder.setFadeoutTime(0);
  balloonBuilder.setFillColor(GRAPHITE_COLOR);
  balloonBuilder.setAnimationCycle(0);
  balloonBuilder.setHideOnClickOutside(true);
  balloonBuilder.setHideOnKeyOutside(false);
  balloonBuilder.setHideOnAction(false);
  balloonBuilder.setCloseButtonEnabled(false);
  balloonBuilder.setBlockClicksThroughBalloon(true);
  balloonBuilder.setRequestFocus(true);
  balloonBuilder.setShadow(true);
  final Balloon balloon = balloonBuilder.createBalloon();
  Disposer.register(balloon, panelDisposable);

  return balloon;
}
 
Example 4
Source File: UsagePreviewPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void showBalloon(Project project, Editor editor, TextRange range, @Nonnull FindModel findModel) {
  try {
    String replacementPreviewText = FindManager.getInstance(project).getStringToReplace(editor.getDocument().getText(range), findModel, range.getStartOffset(), editor.getDocument().getText());
    if (!Registry.is("ide.find.show.replacement.hint.for.simple.regexp") && (Comparing.equal(replacementPreviewText, findModel.getStringToReplace()))) {
      return;
    }
    ReplacementView replacementView = new ReplacementView(replacementPreviewText);

    BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(replacementView);
    balloonBuilder.setFadeoutTime(0);
    balloonBuilder.setFillColor(IdeTooltipManager.GRAPHITE_COLOR);
    balloonBuilder.setAnimationCycle(0);
    balloonBuilder.setHideOnClickOutside(false);
    balloonBuilder.setHideOnKeyOutside(false);
    balloonBuilder.setHideOnAction(false);
    balloonBuilder.setCloseButtonEnabled(true);
    Balloon balloon = balloonBuilder.createBalloon();
    EditorUtil.disposeWithEditor(editor, balloon);

    balloon.show(new ReplacementBalloonPositionTracker(project, editor, range, findModel), Balloon.Position.below);
    editor.putUserData(REPLACEMENT_BALLOON_KEY, balloon);

  }
  catch (FindManager.MalformedReplacementStringException e) {
    //Not a problem, just don't show balloon in this case
  }
}