use of com.intellij.openapi.roots.ContentFolder in project intellij-community by JetBrains.
the class ContentRootPanel method addFolderGroupComponents.
protected void addFolderGroupComponents() {
final SourceFolder[] sourceFolders = getContentEntry().getSourceFolders();
MultiMap<JpsModuleSourceRootType<?>, SourceFolder> folderByType = new MultiMap<>();
for (SourceFolder folder : sourceFolders) {
if (!folder.isSynthetic()) {
folderByType.putValue(folder.getRootType(), folder);
}
}
Insets insets = JBUI.insetsBottom(10);
GridBagConstraints constraints = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, insets, 0, 0);
for (ModuleSourceRootEditHandler<?> editor : myModuleSourceRootEditHandlers) {
Collection<SourceFolder> folders = folderByType.get(editor.getRootType());
if (folders.isEmpty())
continue;
ContentFolder[] foldersArray = folders.toArray(new ContentFolder[folders.size()]);
final JComponent sourcesComponent = createFolderGroupComponent(editor.getRootsGroupTitle(), foldersArray, editor.getRootsGroupColor(), editor);
add(sourcesComponent, constraints);
}
ExcludeFolder[] excluded = getContentEntry().getExcludeFolders();
if (excluded.length > 0) {
final JComponent excludedComponent = createFolderGroupComponent(ProjectBundle.message("module.paths.excluded.group"), excluded, EXCLUDED_COLOR, null);
this.add(excludedComponent, constraints);
}
}
use of com.intellij.openapi.roots.ContentFolder in project intellij-community by JetBrains.
the class ManagingContentRootFoldersTest method testCreationOfExcludedFolderWithUrlWhenFileExists.
public void testCreationOfExcludedFolderWithUrlWhenFileExists() throws IOException {
VirtualFile dir = createSrc();
String url = dir.getUrl();
ContentFolder f = entry.addExcludeFolder(url);
assertEquals(dir, f.getFile());
assertEquals(url, f.getUrl());
}
use of com.intellij.openapi.roots.ContentFolder in project intellij-community by JetBrains.
the class ManagingContentRootFoldersTest method testCreationOfSourceFolderWithUrl.
public void testCreationOfSourceFolderWithUrl() throws IOException {
VirtualFile dir = createSrc();
String url = dir.getUrl();
delete(dir);
ContentFolder f = entry.addSourceFolder(url, false);
assertNull(f.getFile());
assertEquals(url, f.getUrl());
dir = createSrc();
assertEquals(dir, f.getFile());
assertEquals(url, f.getUrl());
}
use of com.intellij.openapi.roots.ContentFolder in project intellij-community by JetBrains.
the class ManagingContentRootFoldersTest method testCreationOfSourceFolderWithUrlWhenFileExists.
public void testCreationOfSourceFolderWithUrlWhenFileExists() throws IOException {
VirtualFile dir = createSrc();
String url = dir.getUrl();
ContentFolder f = entry.addSourceFolder(url, false);
assertEquals(dir, f.getFile());
assertEquals(url, f.getUrl());
}
use of com.intellij.openapi.roots.ContentFolder in project intellij-community by JetBrains.
the class ManagingContentRootFoldersTest method testCreationOfExcludedFolderWithUrl.
public void testCreationOfExcludedFolderWithUrl() throws IOException {
VirtualFile dir = createSrc();
String url = dir.getUrl();
delete(dir);
ContentFolder f = entry.addExcludeFolder(url);
assertNull(f.getFile());
assertEquals(url, f.getUrl());
dir = createSrc();
assertEquals(dir, f.getFile());
assertEquals(url, f.getUrl());
}
Aggregations