@Override
  public void setSelected(@NotNull final AnActionEvent e, final boolean isSelected) {
    final VirtualFile[] selectedFiles = getSelectedFiles();
    assert selectedFiles.length != 0;

    final ContentEntryEditor contentEntryEditor = myEntryTreeEditor.getContentEntryEditor();
    if (contentEntryEditor == null) return;
    
    for (VirtualFile selectedFile : selectedFiles) {
      final SourceFolder sourceFolder = contentEntryEditor.getSourceFolder(selectedFile);
      if (isSelected) {
        JpsModuleSourceRootType<P> type = myEditHandler.getRootType();
        if (sourceFolder == null) { // not marked yet
          P properties = type.createDefaultProperties();
          contentEntryEditor.addSourceFolder(selectedFile, type, properties);
        }
        else if (!type.equals(sourceFolder.getRootType())) {
          P properties;
          if (type.getClass().equals(sourceFolder.getRootType().getClass())) {
            //noinspection unchecked
            properties = SourceRootPropertiesHelper.createPropertiesCopy((P)sourceFolder.getJpsElement().getProperties(), type);
          }
          else {
            properties = type.createDefaultProperties();
          }
          contentEntryEditor.removeSourceFolder(sourceFolder);
          contentEntryEditor.addSourceFolder(selectedFile, type, properties);
        }
      }
      else if (sourceFolder != null) { // already marked
        contentEntryEditor.removeSourceFolder(sourceFolder);
      }
    }
  }
@Override
  public void setSelected(@NotNull final AnActionEvent e, final boolean isSelected)