本文整理汇总了Java中com.intellij.ide.projectView.ViewSettings.isFlattenPackages方法的典型用法代码示例。如果您正苦于以下问题:Java ViewSettings.isFlattenPackages方法的具体用法?Java ViewSettings.isFlattenPackages怎么用?Java ViewSettings.isFlattenPackages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.ViewSettings
的用法示例。
在下文中一共展示了ViewSettings.isFlattenPackages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPackageAsChild
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
public static void addPackageAsChild(@NotNull Collection<AbstractTreeNode> children,
@NotNull PsiPackage aPackage,
@Nullable Module module,
@NotNull ViewSettings settings,
final boolean inLibrary) {
final boolean shouldSkipPackage = settings.isHideEmptyMiddlePackages() && isPackageEmpty(aPackage, module, !settings.isFlattenPackages(), inLibrary);
final Project project = aPackage.getProject();
if (!shouldSkipPackage) {
children.add(new PackageElementNode(project, new PackageElement(module, aPackage, inLibrary), settings));
}
if (settings.isFlattenPackages() || shouldSkipPackage) {
final PsiPackage[] subpackages = getSubpackages(aPackage, module, inLibrary);
for (PsiPackage subpackage : subpackages) {
addPackageAsChild(children, subpackage, module, settings, inLibrary);
}
}
}
示例2: isShowFQName
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
@Override
public boolean isShowFQName(final ViewSettings settings, final Object parentValue, final PsiDirectory value) {
PsiPackage aPackage;
return value != null &&
!(parentValue instanceof Project) &&
settings.isFlattenPackages() &&
(aPackage = JavaDirectoryService.getInstance().getPackage(value)) != null &&
!aPackage.getQualifiedName().isEmpty();
}
示例3: getDirectoryChildren
import com.intellij.ide.projectView.ViewSettings; //导入方法依赖的package包/类
public Collection<AbstractTreeNode> getDirectoryChildren(final PsiDirectory psiDirectory,
final ViewSettings settings,
final boolean withSubDirectories) {
final List<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>();
final Project project = psiDirectory.getProject();
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
final Module module = fileIndex.getModuleForFile(psiDirectory.getVirtualFile());
final ModuleFileIndex moduleFileIndex = module == null ? null : ModuleRootManager.getInstance(module).getFileIndex();
if (!settings.isFlattenPackages() || skipDirectory(psiDirectory)) {
processPsiDirectoryChildren(psiDirectory, directoryChildrenInProject(psiDirectory, settings),
children, fileIndex, null, settings, withSubDirectories);
}
else { // source directory in "flatten packages" mode
final PsiDirectory parentDir = psiDirectory.getParentDirectory();
if (parentDir == null || skipDirectory(parentDir) && withSubDirectories) {
addAllSubpackages(children, psiDirectory, moduleFileIndex, settings);
}
if (withSubDirectories) {
PsiDirectory[] subdirs = psiDirectory.getSubdirectories();
for (PsiDirectory subdir : subdirs) {
if (!skipDirectory(subdir)) {
continue;
}
VirtualFile directoryFile = subdir.getVirtualFile();
if (Registry.is("ide.hide.excluded.files")) {
if (fileIndex.isExcluded(directoryFile)) continue;
}
else {
if (FileTypeRegistry.getInstance().isFileIgnored(directoryFile)) continue;
}
children.add(new PsiDirectoryNode(project, subdir, settings));
}
}
processPsiDirectoryChildren(psiDirectory, psiDirectory.getFiles(), children, fileIndex, moduleFileIndex, settings,
withSubDirectories);
}
return children;
}