Search in sources :

Example 1 with EventStream

use of io.flutter.utils.EventStream in project flutter-intellij by flutter.

the class PropertyBalloonPositionTrackerScreenshot method showPopupHelper.

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;
}
Also used : Disposable(com.intellij.openapi.Disposable) VirtualFile(com.intellij.openapi.vfs.VirtualFile) EventStream(io.flutter.utils.EventStream) JBColor(com.intellij.ui.JBColor) Balloon(com.intellij.openapi.ui.popup.Balloon) JBColor(com.intellij.ui.JBColor) StableWidgetTracker(io.flutter.hotui.StableWidgetTracker) BalloonBuilder(com.intellij.openapi.ui.popup.BalloonBuilder)

Aggregations

Disposable (com.intellij.openapi.Disposable)1 Balloon (com.intellij.openapi.ui.popup.Balloon)1 BalloonBuilder (com.intellij.openapi.ui.popup.BalloonBuilder)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 JBColor (com.intellij.ui.JBColor)1 StableWidgetTracker (io.flutter.hotui.StableWidgetTracker)1 EventStream (io.flutter.utils.EventStream)1