• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ViewSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ide.projectView.ViewSettings的典型用法代码示例。如果您正苦于以下问题:Java ViewSettings类的具体用法?Java ViewSettings怎么用?Java ViewSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ViewSettings类属于com.intellij.ide.projectView包,在下文中一共展示了ViewSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: modify

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@NotNull
@Override
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
    ArrayList<AbstractTreeNode> nodes = new ArrayList<AbstractTreeNode>();

    if (isLanguageFolder(parent)) {
        if (children.size() > 0 && parent.getValue() instanceof PsiDirectory) {
            Collection<PsiFileNode> childrenPsi2 = new ArrayList<>();
            for (AbstractTreeNode eachChild : children) {
                if (!(eachChild.getValue() instanceof PsiFile)) continue;
                PsiFile psiFile = (PsiFile) eachChild.getValue();
                LanguageNodeFile nodeFile = new LanguageNodeFile(parent.getProject(), psiFile, settings);
                childrenPsi2.add(nodeFile);
            }
            LanguageNestingNode languageFormNode = new LanguageNestingNode(childrenPsi2.iterator().next(), childrenPsi2);
            nodes.add(languageFormNode);
        }
    } else {
        nodes.addAll(children);
    }
    return nodes;
}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:23,代码来源:LanguageTreeStructureProvider.java


示例2: 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


示例3: getNodesToAdd

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@NotNull
public static Collection<AbstractTreeNode> getNodesToAdd(final DataContext dataContext, final boolean inProjectView) {
  Project project = CommonDataKeys.PROJECT.getData(dataContext);

  if (project == null) return Collections.emptyList();

  Module moduleContext = LangDataKeys.MODULE_CONTEXT.getData(dataContext);

  Collection<AbstractTreeNode> nodesToAdd = null;
  for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) {
    nodesToAdd = provider.getFavoriteNodes(dataContext, ViewSettings.DEFAULT);
    if (nodesToAdd != null) {
      break;
    }
  }

  if (nodesToAdd == null) {
    Object elements = collectSelectedElements(dataContext);
    if (elements != null) {
      nodesToAdd = createNodes(project, moduleContext, elements, inProjectView, ViewSettings.DEFAULT);
    }
  }
  return nodesToAdd == null ? Collections.<AbstractTreeNode>emptyList() : nodesToAdd;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AddToFavoritesAction.java


示例4: addPsiElementNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
private static void addPsiElementNode(PsiElement psiElement,
                                      final Project project,
                                      final ArrayList<AbstractTreeNode> result,
                                      final ViewSettings favoritesConfig) {

  Class<? extends AbstractTreeNode> klass = getPsiElementNodeClass(psiElement);
  if (klass == null) {
    psiElement = PsiTreeUtil.getParentOfType(psiElement, PsiFile.class);
    if (psiElement != null) {
      klass = PsiFileNode.class;
    }
  }

  final Object value = psiElement;
  try {
    if (klass != null && value != null) {
      result.add(ProjectViewNode.createTreeNode(klass, project, value, favoritesConfig));
    }
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AddToFavoritesAction.java


示例5: modify

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@NotNull
@SuppressWarnings({"RawUseOfParameterizedType", "unchecked"})
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
  Collection<AbstractTreeNode> l = children;
  int i = 0;
  for (AbstractTreeNode o : children) {
    if (o instanceof ProjectViewNode) {
      final ProjectViewNode node = (ProjectViewNode)o;
      final Object element = node.getValue();
      if (element instanceof PsiFile) {
        if (XsltSupport.isXsltFile((PsiFile)element)) {
          if (l == children && l.getClass() != ArrayList.class) {
            l = new ArrayList<AbstractTreeNode>(children);
          }
          final XsltFileNode fileNode = new XsltFileNode(myProject, (PsiFile)element, settings);
          ((List<AbstractTreeNode>)l).set(i, fileNode);
        }
      }
    }
    i++;
  }
  return l;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:XsltTreeStructureProvider.java


示例6: getChildren

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@Override
@NotNull
public Collection<? extends AbstractTreeNode> getChildren() {
  final List<AbstractTreeNode> nodesList = new ArrayList<AbstractTreeNode>();

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


示例7: addAllSubpackages

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public void addAllSubpackages(List<AbstractTreeNode> container,
                              PsiDirectory dir,
                              @Nullable ModuleFileIndex moduleFileIndex,
                              ViewSettings viewSettings) {
  final Project project = dir.getProject();
  PsiDirectory[] subdirs = dir.getSubdirectories();
  for (PsiDirectory subdir : subdirs) {
    if (skipDirectory(subdir)) {
      continue;
    }
    if (moduleFileIndex != null && !moduleFileIndex.isInContent(subdir.getVirtualFile())) {
      container.add(new PsiDirectoryNode(project, subdir, viewSettings));
      continue;
    }
    if (viewSettings.isHideEmptyMiddlePackages()) {
      if (!isEmptyMiddleDirectory(subdir, false)) {

        container.add(new PsiDirectoryNode(project, subdir, viewSettings));
      }
    }
    else {
      container.add(new PsiDirectoryNode(project, subdir, viewSettings));
    }
    addAllSubpackages(container, subdir, moduleFileIndex, viewSettings);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ProjectViewDirectoryHelper.java


示例8: create

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@Nullable
public static PyRemoteLibrariesNode create(@NotNull Project project, @NotNull Sdk sdk, ViewSettings settings) {
  VirtualFile remoteLibrary = PySdkUtil.findAnyRemoteLibrary(sdk);

  if (remoteLibrary != null && remoteLibrary.getFileType() instanceof ArchiveFileType) {
    remoteLibrary = JarFileSystem.getInstance().getLocalVirtualFileFor(remoteLibrary);
  }

  if (remoteLibrary != null) {
    final VirtualFile remoteLibraries = remoteLibrary.getParent();

    final PsiDirectory remoteLibrariesDirectory = PsiManager.getInstance(project).findDirectory(remoteLibraries);
    return new PyRemoteLibrariesNode(sdk, project, remoteLibrariesDirectory, settings);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PyRemoteLibrariesNode.java


示例9: getChildren

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public static Collection<AbstractTreeNode> getChildren(AndroidFacet facet,
                                                       ViewSettings settings,
                                                       AndroidProjectViewPane pane,
                                                       List<IdeaSourceProvider> providers) {
  Project project = facet.getModule().getProject();
  List<AbstractTreeNode> result = Lists.newArrayList();

  HashMultimap<AndroidSourceType,VirtualFile> sourcesByType = getSourcesBySourceType(providers);

  for (AndroidSourceType sourceType : sourcesByType.keySet()) {
    if (sourceType == AndroidSourceType.MANIFEST) {
      result.add(new AndroidManifestsGroupNode(project, facet, settings, sourcesByType.get(sourceType)));
    }
    else if (sourceType == AndroidSourceType.RES) {
      result.add(new AndroidResFolderNode(project, facet, settings, sourcesByType.get(sourceType), pane));
    }
    else {
      result.add(new AndroidSourceTypeNode(project, facet, settings, sourceType, sourcesByType.get(sourceType), pane));
    }
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AndroidModuleNode.java


示例10: modify

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@NotNull
@Override
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
  if (!ApplicationManager.getApplication().isInternal()) {
    return children;
  }

  if (parent instanceof PsiDirectoryNode) {
    PsiDirectory directory = ((PsiDirectoryNode)parent).getValue();
    if (!directory.getName().equals("res")) {
      return children;
    }
    Module module = ModuleUtil.findModuleForPsiElement(directory);
    AndroidFacet facet = AndroidFacet.getInstance(module);
    if (facet == null) {
      return children;
    }
    return mergeResourceDirectories(children, settings);
  }
  return children;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ResourceMergerTreeStructureProvider.java


示例11: modify

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@Override
@NotNull
public Collection<AbstractTreeNode> modify(
    @NotNull final AbstractTreeNode parent,
    @NotNull final Collection<AbstractTreeNode> children,
    final ViewSettings settings
) {
    Validate.notNull(parent);
    Validate.notNull(children);

    if (this.isNotHybrisProject()) {
        return children;
    }

    if (parent instanceof JunkProjectViewNode) {
        return this.isCompactEmptyMiddleFoldersEnabled(settings)
            ? this.compactEmptyMiddlePackages(parent, children)
            : children;
    }

    if (parent instanceof ProjectViewModuleGroupNode) {
        modifyIcons((ProjectViewModuleGroupNode) parent, children);
    }

    if (parent instanceof ExternalLibrariesNode) {
        return this.modifyExternalLibrariesNodes(children);
    }

    final Collection<AbstractTreeNode> childrenWithProcessedJunkFiles = this.processJunkFiles(children, settings);

    return this.isCompactEmptyMiddleFoldersEnabled(settings)
        ? this.compactEmptyMiddlePackages(parent, childrenWithProcessedJunkFiles)
        : childrenWithProcessedJunkFiles;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:35,代码来源:HybrisProjectView.java


示例12: JunkProjectViewNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public JunkProjectViewNode(
    final Project project,
    final List<AbstractTreeNode> children,
    final ViewSettings settings
) {
    super(project, children, settings);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:JunkProjectViewNode.java


示例13: CourseDirectoryNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public CourseDirectoryNode(@NotNull Project project,
                           PsiDirectory value,
                           ViewSettings viewSettings,
                           @NotNull Course course) {
  super(project, value, viewSettings);
  myProject = project;
  myViewSettings = viewSettings;
  myCourse = course;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:10,代码来源:CourseDirectoryNode.java


示例14: modify

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@NotNull
@Override
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent,
                                           @NotNull Collection<AbstractTreeNode> children,
                                           ViewSettings settings) {
  Project project = parent.getProject();
  if (project == null || !shouldModify(project)) {
    return children;
  }
  Course course = StudyTaskManager.getInstance(project).getCourse();
  if (course == null) {
    return children;
  }
  Collection<AbstractTreeNode> modifiedNodes = new ArrayList<>();
  for (AbstractTreeNode node : children) {
    if (parent instanceof ProjectViewProjectNode && node instanceof PsiDirectoryNode) {
      modifiedNodes.add(createCourseNode(project, node, settings, course));
      continue;
    }
    if (parent instanceof StudyDirectoryNode) {
      AbstractTreeNode modifiedNode = ((StudyDirectoryNode)parent).modifyChildNode(node);
      if (modifiedNode != null) {
        modifiedNodes.add(modifiedNode);
      }
    }
  }
  return modifiedNodes;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:29,代码来源:StudyTreeStructureProvider.java


示例15: TaskDirectoryNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public TaskDirectoryNode(@NotNull Project project,
                         PsiDirectory value,
                         ViewSettings viewSettings,
                         @NotNull Task task) {
  super(project, value, viewSettings);
  myProject = project;
  myViewSettings = viewSettings;
  myTask = task;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:10,代码来源:TaskDirectoryNode.java


示例16: DirectoryNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public DirectoryNode(@NotNull Project project,
                     PsiDirectory value,
                     ViewSettings viewSettings) {
  super(project, value, viewSettings);
  myProject = project;
  myViewSettings = viewSettings;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:8,代码来源:DirectoryNode.java


示例17: LessonDirectoryNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public LessonDirectoryNode(@NotNull Project project,
                           PsiDirectory value,
                           ViewSettings viewSettings,
                           @NotNull Lesson lesson) {
  super(project, value, viewSettings);
  myProject = project;
  myViewSettings = viewSettings;
  myLesson = lesson;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:10,代码来源:LessonDirectoryNode.java


示例18: CCStudentInvisibleFileNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public CCStudentInvisibleFileNode(Project project,
                                  PsiFile value,
                                  ViewSettings viewSettings,
                                  String name) {
  super(project, value, viewSettings);
  myName = name;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:8,代码来源:CCStudentInvisibleFileNode.java


示例19: TestsTopLevelDirectoryNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
public TestsTopLevelDirectoryNode(Module module,
                                  PsiDirectory testDir,
                                  ViewSettings viewSettings,
                                  final String title,
                                  final Icon icon, final Icon methodIcon) {
  super(module, testDir, viewSettings, title, icon, TESTS_FOLDER);
  myMethodIcon = methodIcon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TestsTopLevelDirectoryNode.java


示例20: createNode

import com.intellij.ide.projectView.ViewSettings; //导入依赖的package包/类
@Override
public AbstractTreeNode createNode(final Project project, final Object element, final ViewSettings viewSettings) {
  if (element instanceof PsiField) {
    return new FieldSmartPointerNode(project, element, viewSettings);
  }
  return super.createNode(project, element, viewSettings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PsiFieldFavoriteNodeProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XulDomContainer类代码示例发布时间:2022-05-21
下一篇:
Java HFileCleaner类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap