use of com.intellij.ide.projectView.ViewSettings in project intellij-community by JetBrains.
the class MvcModuleNode method getChildren.
@Override
@NotNull
public Collection<? extends AbstractTreeNode> getChildren() {
final List<AbstractTreeNode> nodesList = new ArrayList<>();
final Module module = getValue();
final ViewSettings viewSettings = getSettings();
final VirtualFile root = myDescriptor.getFramework().findAppRoot(module);
if (root == null) {
return Collections.emptyList();
}
myDescriptor.fillModuleChildren(nodesList, module, viewSettings, root);
return nodesList;
}
use of com.intellij.ide.projectView.ViewSettings in project android by JetBrains.
the class AndroidViewProjectNode method getChildren.
@NotNull
@Override
public Collection<? extends AbstractTreeNode> getChildren() {
Project project = getProject();
assert project != null;
ViewSettings settings = getSettings();
// add a node for every module
// TODO: make this conditional on getSettings().isShowModules(), otherwise collapse them all at the root
List<Module> modules = Arrays.asList(ModuleManager.getInstance(project).getModules());
List<AbstractTreeNode> children = Lists.newArrayListWithExpectedSize(modules.size());
for (Module module : modules) {
if (isRootModuleWithNoSources(module)) {
// If we detect such a module, then we don't show it..
continue;
}
AndroidFacet androidFacet = AndroidFacet.getInstance(module);
NdkFacet ndkFacet = NdkFacet.getInstance(module);
if (androidFacet != null && androidFacet.getAndroidModel() != null) {
children.add(new AndroidModuleNode(project, module, settings, myProjectViewPane));
} else if (ndkFacet != null && ndkFacet.getNdkModuleModel() != null) {
children.add(new NdkModuleNode(project, module, settings));
} else {
children.add(new NonAndroidModuleNode(project, module, settings));
}
}
// are still visible. See https://code.google.com/p/android/issues/detail?id=76564
if (children.isEmpty() && isBuildWithGradle(project) && GradleSyncState.getInstance(project).lastSyncFailed()) {
PsiDirectory dir = PsiManager.getInstance(project).findDirectory(project.getBaseDir());
if (dir != null) {
children.add(new PsiDirectoryNode(project, dir, settings));
}
}
if (isBuildWithGradle(project)) {
children.add(new AndroidBuildScriptsGroupNode(project, settings));
}
ExternalBuildFilesGroupNode externalBuildFilesNode = new ExternalBuildFilesGroupNode(project, settings);
if (!externalBuildFilesNode.getChildren().isEmpty()) {
children.add(externalBuildFilesNode);
}
return children;
}
Aggregations