9
9
import com .intellij .ide .browsers .BrowserLauncher ;
10
10
import com .intellij .openapi .Disposable ;
11
11
import com .intellij .openapi .application .ApplicationManager ;
12
- import com .intellij .openapi .components .PersistentStateComponent ;
13
12
import com .intellij .openapi .components .Storage ;
14
13
import com .intellij .openapi .diagnostic .Logger ;
15
14
import com .intellij .openapi .progress .EmptyProgressIndicator ;
43
42
import io .flutter .sdk .FlutterSdkVersion ;
44
43
import io .flutter .settings .FlutterSettings ;
45
44
import io .flutter .toolwindow .InspectorViewToolWindowManagerListener ;
46
- import io .flutter .utils .*;
45
+ import io .flutter .utils .AsyncUtils ;
46
+ import io .flutter .utils .JxBrowserUtils ;
47
+ import io .flutter .utils .LabelInput ;
48
+ import io .flutter .utils .OpenApiUtils ;
47
49
import org .dartlang .vm .service .VmService ;
48
50
import org .jetbrains .annotations .NotNull ;
49
51
import org .jetbrains .annotations .Nullable ;
59
61
name = "InspectorView" ,
60
62
storages = {@ Storage ("$WORKSPACE_FILE$" )}
61
63
)
62
- public class InspectorView implements PersistentStateComponent < InspectorViewState >, Disposable {
64
+ public class InspectorView implements Disposable {
63
65
private static final Logger LOG = Logger .getInstance (InspectorView .class );
64
66
65
67
public static final @ NotNull String TOOL_WINDOW_ID = "Flutter Inspector" ;
@@ -71,13 +73,6 @@ public class InspectorView implements PersistentStateComponent<InspectorViewStat
71
73
protected static final String DEVTOOLS_FAILED_LABEL = "Setting up DevTools failed." ;
72
74
protected static final int INSTALLATION_WAIT_LIMIT_SECONDS = 2000 ;
73
75
74
- protected final @ NotNull EventStream <Boolean > shouldAutoHorizontalScroll = new EventStream <>(InspectorViewState .AUTO_SCROLL_DEFAULT );
75
- protected final @ NotNull EventStream <Boolean > highlightNodesShownInBothTrees =
76
- new EventStream <>(InspectorViewState .HIGHLIGHT_NODES_SHOWN_IN_BOTH_TREES_DEFAULT );
77
-
78
- @ NotNull
79
- private final InspectorViewState state = new InspectorViewState ();
80
-
81
76
@ VisibleForTesting
82
77
@ NotNull
83
78
public final ViewUtils viewUtils ;
@@ -106,35 +101,18 @@ protected InspectorView(@NotNull Project project,
106
101
this .jxBrowserUtils = jxBrowserUtils ;
107
102
this .jxBrowserManager = jxBrowserManager ;
108
103
this .viewUtils = viewUtils != null ? viewUtils : new ViewUtils ();
109
-
110
- shouldAutoHorizontalScroll .listen (state ::setShouldAutoScroll );
111
- highlightNodesShownInBothTrees .listen (state ::setHighlightNodesShownInBothTrees );
112
104
}
113
105
114
106
@ Override
115
107
public void dispose () {
116
108
Disposer .dispose (this );
117
109
}
118
110
119
- @ NotNull
120
- @ Override
121
- public InspectorViewState getState () {
122
- return state ;
123
- }
124
-
125
111
@ NotNull
126
112
public Project getProject () {
127
113
return myProject ;
128
114
}
129
115
130
- @ Override
131
- public void loadState (@ NotNull InspectorViewState state ) {
132
- this .state .copyFrom (state );
133
-
134
- shouldAutoHorizontalScroll .setValue (this .state .getShouldAutoScroll ());
135
- highlightNodesShownInBothTrees .setValue (this .state .getHighlightNodesShownInBothTrees ());
136
- }
137
-
138
116
void initToolWindow (@ NotNull ToolWindow window ) {
139
117
if (window .isDisposed ()) return ;
140
118
0 commit comments