From 29f18909654d47daff273ad6e96577985c530855 Mon Sep 17 00:00:00 2001 From: pq Date: Fri, 9 May 2025 10:23:52 -0700 Subject: [PATCH] [CQ] remove unused `ViewListener` --- .../src/io/flutter/utils/ViewListener.java | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 flutter-idea/src/io/flutter/utils/ViewListener.java diff --git a/flutter-idea/src/io/flutter/utils/ViewListener.java b/flutter-idea/src/io/flutter/utils/ViewListener.java deleted file mode 100644 index a286d37781..0000000000 --- a/flutter-idea/src/io/flutter/utils/ViewListener.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.flutter.utils; - -import com.intellij.ide.util.PropertiesComponent; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.wm.ToolWindow; -import com.intellij.openapi.wm.ToolWindowManager; -import com.intellij.openapi.wm.ex.ToolWindowManagerListener; -import org.jetbrains.annotations.NotNull; - -/** - * Helps to initialize a tool window with the same visibility state as when the project was previously closed. - */ -public abstract class ViewListener implements ToolWindowManagerListener { - private final @NotNull Project project; - private final String toolWindowId; - private final String toolWindowVisibleProperty; - - public ViewListener(@NotNull Project project, String toolWindowId, String toolWindowVisibleProperty) { - this.project = project; - this.toolWindowId = toolWindowId; - this.toolWindowVisibleProperty = toolWindowVisibleProperty; - } - - @Override - public void stateChanged(@NotNull ToolWindowManager toolWindowManager) { - ToolWindow toolWindow = toolWindowManager.getToolWindow(toolWindowId); - // We only make tool windows available once we've found a Flutter project, so we want to avoid setting the visible property until then. - if (toolWindow != null && toolWindow.isAvailable()) { - PropertiesComponent.getInstance(project).setValue(toolWindowVisibleProperty, toolWindow.isVisible(), false); - } - } -} \ No newline at end of file