当前位置: 首页>>代码示例>>Java>>正文


Java ViewSettings.isFlattenPackages方法代码示例

本文整理汇总了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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PackageUtil.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JavaProjectViewDirectoryHelper.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ProjectViewDirectoryHelper.java


注:本文中的com.intellij.ide.projectView.ViewSettings.isFlattenPackages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。