void (@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) { if (sourceFolder == null) { // not marked yet P properties = myEditHandler.getRootType().createDefaultProperties(); contentEntryEditor.addSourceFolder(selectedFile, myEditHandler.getRootType(), properties); } else if (!myEditHandler.getRootType().equals(sourceFolder.getRootType())) { P properties; if (myEditHandler.getRootType().getClass().equals(sourceFolder.getRootType().getClass())) { properties = (P)sourceFolder.getJpsElement().getProperties().getBulkModificationSupport().createCopy(); } else { properties = myEditHandler.getRootType().createDefaultProperties(); } contentEntryEditor.removeSourceFolder(sourceFolder); contentEntryEditor.addSourceFolder(selectedFile, myEditHandler.getRootType(), properties); } } else if (sourceFolder != null) { // already marked contentEntryEditor.removeSourceFolder(sourceFolder); } } }