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


Java AbstractModuleNode类代码示例

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


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

示例1: doSelectModuleOrGroup

import com.intellij.ide.projectView.impl.nodes.AbstractModuleNode; //导入依赖的package包/类
private void doSelectModuleOrGroup(final Object toSelect, final boolean requestFocus) {
  ToolWindowManager windowManager=ToolWindowManager.getInstance(myProject);
  final Runnable runnable = new Runnable() {
    @Override
    public void run() {
      ProjectView projectView = ProjectView.getInstance(myProject);
      if (requestFocus) {
        projectView.changeView(getId(), getSubId());
      }
      ((BaseProjectTreeBuilder)getTreeBuilder()).selectInWidth(toSelect, requestFocus, new Condition<AbstractTreeNode>(){
        @Override
        public boolean value(final AbstractTreeNode node) {
          return node instanceof AbstractModuleNode || node instanceof ModuleGroupNode || node instanceof AbstractProjectNode;
        }
      });
    }
  };
  if (requestFocus) {
    windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW).activate(runnable);
  }
  else {
    runnable.run();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AbstractProjectViewPane.java

示例2: getSelectedDirectoriesInAmbiguousCase

import com.intellij.ide.projectView.impl.nodes.AbstractModuleNode; //导入依赖的package包/类
@NotNull
protected PsiDirectory[] getSelectedDirectoriesInAmbiguousCase(@NotNull final DefaultMutableTreeNode node) {
  final Object userObject = node.getUserObject();
  if (userObject instanceof AbstractModuleNode) {
    final Module module = ((AbstractModuleNode)userObject).getValue();
    if (module != null) {
      final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
      final VirtualFile[] sourceRoots = moduleRootManager.getSourceRoots();
      List<PsiDirectory> dirs = new ArrayList<PsiDirectory>(sourceRoots.length);
      final PsiManager psiManager = PsiManager.getInstance(myProject);
      for (final VirtualFile sourceRoot : sourceRoots) {
        final PsiDirectory directory = psiManager.findDirectory(sourceRoot);
        if (directory != null) {
          dirs.add(directory);
        }
      }
      return dirs.toArray(new PsiDirectory[dirs.size()]);
    }
  }
  return PsiDirectory.EMPTY_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AbstractProjectViewPane.java

示例3: getSelectedDirectoriesInAmbiguousCase

import com.intellij.ide.projectView.impl.nodes.AbstractModuleNode; //导入依赖的package包/类
protected PsiDirectory[] getSelectedDirectoriesInAmbiguousCase(@NotNull final DefaultMutableTreeNode node) {
  final Object userObject = node.getUserObject();
  if (userObject instanceof AbstractModuleNode) {
    final Module module = ((AbstractModuleNode)userObject).getValue();
    if (module != null) {
      final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
      final VirtualFile[] sourceRoots = moduleRootManager.getSourceRoots();
      List<PsiDirectory> dirs = new ArrayList<PsiDirectory>(sourceRoots.length);
      final PsiManager psiManager = PsiManager.getInstance(myProject);
      for (final VirtualFile sourceRoot : sourceRoots) {
        final PsiDirectory directory = psiManager.findDirectory(sourceRoot);
        if (directory != null) {
          dirs.add(directory);
        }
      }
      return dirs.toArray(new PsiDirectory[dirs.size()]);
    }
  }
  return PsiDirectory.EMPTY_ARRAY;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:AbstractProjectViewPane.java

示例4: doSelectModuleOrGroup

import com.intellij.ide.projectView.impl.nodes.AbstractModuleNode; //导入依赖的package包/类
private void doSelectModuleOrGroup(final Object toSelect, final boolean requestFocus) {
  ToolWindowManager windowManager = ToolWindowManager.getInstance(myProject);
  final Runnable runnable = () -> {
    ProjectView projectView = ProjectView.getInstance(myProject);
    if (requestFocus) {
      projectView.changeView(getId(), getSubId());
    }
    ((BaseProjectTreeBuilder)getTreeBuilder())
            .selectInWidth(toSelect, requestFocus, node -> node instanceof AbstractModuleNode || node instanceof ModuleGroupNode || node instanceof AbstractProjectNode);
  };
  if (requestFocus) {
    windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW).activate(runnable);
  }
  else {
    runnable.run();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:AbstractProjectViewPane.java

示例5: getSelectedDirectoriesInAmbiguousCase

import com.intellij.ide.projectView.impl.nodes.AbstractModuleNode; //导入依赖的package包/类
@Nonnull
protected PsiDirectory[] getSelectedDirectoriesInAmbiguousCase(@Nonnull final DefaultMutableTreeNode node) {
  final Object userObject = node.getUserObject();
  if (userObject instanceof AbstractModuleNode) {
    final Module module = ((AbstractModuleNode)userObject).getValue();
    if (module != null) {
      final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
      final VirtualFile[] sourceRoots = moduleRootManager.getSourceRoots();
      List<PsiDirectory> dirs = new ArrayList<>(sourceRoots.length);
      final PsiManager psiManager = PsiManager.getInstance(myProject);
      for (final VirtualFile sourceRoot : sourceRoots) {
        final PsiDirectory directory = psiManager.findDirectory(sourceRoot);
        if (directory != null) {
          dirs.add(directory);
        }
      }
      return dirs.toArray(new PsiDirectory[dirs.size()]);
    }
  }
  return PsiDirectory.EMPTY_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:AbstractProjectViewPane.java


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