class DeviceAndSnapshotComboBoxAction extends ComboBoxAction {

  @Override
  public final void update(@NotNull AnActionEvent event) {
    Presentation presentation = event.getPresentation();
    Project project = event.getProject();

    if (project == null) {
      presentation.setVisible(false);
      return;
    }

    if (!AndroidUtils.hasAndroidFacets(project)) {
      presentation.setVisible(false);
      return;
    }

    updatePresentation(presentation, RunManager.getInstance(project).getSelectedConfiguration());

    List<Device> devices = getDevices(project);
    Device device = getSelectedDevice(project, devices);

    if (event.getPlace().equals(ActionPlaces.MAIN_MENU)) {
      presentation.setIcon(null);
      presentation.setText("Select Device...");
    }
    else if (devices.isEmpty()) {
      presentation.setIcon(null);
      presentation.setText("No Devices");
    }
    else {
      assert device != null;

      presentation.setIcon(device.getIcon());
      presentation.setText(getText(device, devices, mySelectDeviceSnapshotComboBoxSnapshotsEnabled.get()), false);
    }

    updateExecutionTargetManager(project, device);
  }

  @SuppressWarnings("unused") private  DeviceAndSnapshotComboBoxAction();
  @VisibleForTesting public  DeviceAndSnapshotComboBoxAction(@NotNull Supplier<Boolean> selectDeviceSnapshotComboBoxSnapshotsEnabled,
                                         @NotNull Function<Project, AsyncDevicesGetter> devicesGetterGetter,
                                         @NotNull Function<Project, PropertiesComponent> getProperties,
                                         @NotNull Clock clock);

}