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;
}
Aggregations