88import com .intellij .icons .AllIcons ;
99import com .intellij .ide .ActivityTracker ;
1010import com .intellij .ide .DataManager ;
11- import com .intellij .openapi .actionSystem .*;
11+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
12+ import com .intellij .openapi .actionSystem .AnAction ;
13+ import com .intellij .openapi .actionSystem .AnActionEvent ;
14+ import com .intellij .openapi .actionSystem .CommonDataKeys ;
15+ import com .intellij .openapi .actionSystem .DataContext ;
16+ import com .intellij .openapi .actionSystem .DataKey ;
17+ import com .intellij .openapi .actionSystem .DefaultActionGroup ;
18+ import com .intellij .openapi .actionSystem .PlatformCoreDataKeys ;
19+ import com .intellij .openapi .actionSystem .Presentation ;
20+ import com .intellij .openapi .actionSystem .Separator ;
1221import com .intellij .openapi .actionSystem .ex .CustomComponentAction ;
1322import com .intellij .openapi .application .Application ;
1423import com .intellij .openapi .application .ApplicationManager ;
3140import com .intellij .util .ui .UIUtil ;
3241import icons .FlutterIcons ;
3342import io .flutter .FlutterBundle ;
43+ import io .flutter .analytics .Analytics ;
44+ import io .flutter .analytics .AnalyticsData ;
3445import io .flutter .logging .PluginLogger ;
3546import io .flutter .run .FlutterDevice ;
3647import io .flutter .run .daemon .DeviceService ;
3950import org .jetbrains .annotations .NotNull ;
4051import org .jetbrains .annotations .Nullable ;
4152
42- import javax .swing .*;
43- import java .awt .*;
53+ import javax .swing .ButtonModel ;
54+ import javax .swing .Icon ;
55+ import javax .swing .JButton ;
56+ import javax .swing .JComponent ;
57+ import javax .swing .JPanel ;
58+ import javax .swing .SwingUtilities ;
59+ import java .awt .BorderLayout ;
60+ import java .awt .Color ;
61+ import java .awt .Component ;
62+ import java .awt .Container ;
63+ import java .awt .Dimension ;
64+ import java .awt .FontMetrics ;
65+ import java .awt .Graphics ;
66+ import java .awt .Graphics2D ;
67+ import java .awt .RenderingHints ;
4468import java .awt .event .MouseAdapter ;
4569import java .awt .event .MouseEvent ;
46- import java .util .*;
70+ import java .util .ArrayList ;
71+ import java .util .Collection ;
72+ import java .util .Collections ;
4773import java .util .List ;
74+ import java .util .Objects ;
4875
4976public class DeviceSelectorAction extends AnAction implements CustomComponentAction , DumbAware {
5077 private static final @ NotNull Logger LOG = PluginLogger .createLogger (DeviceSelectorAction .class );
@@ -89,7 +116,7 @@ public class DeviceSelectorAction extends AnAction implements CustomComponentAct
89116 * </p>
90117 *
91118 * @return A {@link Color} suitable for toolbar text that adapts to the current theme,
92- * including configurations like light themes with dark headers.
119+ * including configurations like light themes with dark headers.
93120 */
94121 @ NotNull Color getToolbarForegroundColor () {
95122 return JBColor .namedColor (TOOLBAR_FOREGROUND_KEY , UIUtil .getLabelForeground ());
@@ -105,7 +132,7 @@ public class DeviceSelectorAction extends AnAction implements CustomComponentAct
105132 * </p>
106133 *
107134 * @return A {@link Color} suitable for toolbar icon button hover states that adapts to the
108- * current theme, ensuring consistency with other toolbar actions.
135+ * current theme, ensuring consistency with other toolbar actions.
109136 */
110137 @ NotNull Color getToolbarHoverBackgroundColor () {
111138 return JBColor .namedColor (TOOLBAR_ICON_HOVER_BACKGROUND_KEY , JBUI .CurrentTheme .ActionButton .hoverBackground ());
@@ -122,6 +149,8 @@ public void actionPerformed(@NotNull AnActionEvent e) {
122149 return ;
123150 }
124151
152+ Analytics .report (AnalyticsData .forAction (this , e ));
153+
125154 final DefaultActionGroup group = new DefaultActionGroup ();
126155 group .addAll (actions );
127156
0 commit comments