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

Java ProjectViewImpl类代码示例

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

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



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

示例1: selectInTargetFile

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
private void selectInTargetFile(final VirtualFile targetFile) {
    UIUtil.invokeLaterIfNeeded(new Runnable() {
        public void run() {
            Project project = deviceResult.anActionEvent.getProject();
            Editor editor = deviceResult.anActionEvent.getData(PlatformDataKeys.EDITOR);
            MySelectInContext selectInContext = new MySelectInContext(targetFile, editor, project);
            ProjectViewImpl projectView = (ProjectViewImpl) ProjectView.getInstance(project);
            AbstractProjectViewPane currentProjectViewPane = projectView.getCurrentProjectViewPane();
            SelectInTarget target = currentProjectViewPane.createSelectInTarget();
            if (target != null && target.canSelect(selectInContext)) {
                target.selectIn(selectInContext, false);
            } else {
                selectInContext = new MySelectInContext(targetFile.getParent(), editor, project);
                if (target != null && target.canSelect(selectInContext)) {
                    target.selectIn(selectInContext, false);
                }
            }
        }
    });
}
 
开发者ID:zzz40500,项目名称:ADB-Duang,代码行数:21,代码来源:PullCommand.java


示例2: setUp

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();

  myPane = new TestProjectViewPSIPane(myProject, myStructure, 9);
  myPane.createComponent();
  Disposer.register(myStructure, myPane);

  myProjectView = ProjectView.getInstance(myProject);
  myProjectView.addProjectPane(myPane);
  myOriginalManualOrder = myProjectView.isManualOrder(myPane.getId());
  myOriginalSortByType = myProjectView.isSortByType(myPane.getId());
  myOriginalFoldersAlwaysOnTop = ((ProjectViewImpl)myProjectView).isFoldersAlwaysOnTop();

  TreeUtil.expand(myPane.getTree(), 2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ProjectTreeSortingTest.java


示例3: testSortByTypeBetweenFilesAndFolders

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public void testSortByTypeBetweenFilesAndFolders() throws Exception {
  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(false);
  myProjectView.setSortByType(myPane.getId(), false);
  assertTree("-sortByTypeBetweenFilesAndFolders\n" +
             " a.java\n" +
             " +a.java_folder\n" +
             " a.txt\n" +
             " +a_folder\n" +
             " b.java\n" +
             " +b.java_folder\n" +
             " b.txt\n" +
             " +b_folder\n");

  myProjectView.setSortByType(myPane.getId(), true);
  assertTree("-sortByTypeBetweenFilesAndFolders\n" +
             " a.java\n" +
             " b.java\n" +
             " +a.java_folder\n" +
             " +b.java_folder\n" +
             " a.txt\n" +
             " b.txt\n" +
             " +a_folder\n" +
             " +b_folder\n");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ProjectTreeSortingTest.java


示例4: doTest

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
private void doTest(final boolean showModules, final boolean showLibraryContents, @NonNls final String expected, final int levels) {
  final ProjectViewImpl projectView = (ProjectViewImpl)ProjectView.getInstance(myProject);

  projectView.setShowModules(showModules, PackageViewPane.ID);

  projectView.setShowLibraryContents(showLibraryContents, PackageViewPane.ID);

  projectView.setFlattenPackages(false, PackageViewPane.ID);
  projectView.setHideEmptyPackages(true, PackageViewPane.ID);

  PackageViewPane packageViewPane = new PackageViewPane(myProject);
  packageViewPane.createComponent();
  ((AbstractProjectTreeStructure) packageViewPane.getTreeStructure()).setProviders(new ResourceBundleGrouper(myProject));
  packageViewPane.updateFromRoot(true);
  JTree tree = packageViewPane.getTree();
  TreeUtil.expand(tree, levels);
  IdeaTestUtil.assertTreeEqual(tree, expected);
  BaseProjectViewTestCase.checkContainsMethod(packageViewPane.getTreeStructure().getRootElement(), packageViewPane.getTreeStructure());
  Disposer.dispose(packageViewPane);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:PackagesTreeStructureTest.java


示例5: setupImpl

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public static void setupImpl(@NotNull Project project, boolean loadPaneExtensions) {
  ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  ToolWindow toolWindow = toolWindowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);

  if (toolWindow == null) {
    ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
    for (final ToolWindowEP bean : beans) {
      if (bean.id.equals(ToolWindowId.PROJECT_VIEW)) {
        toolWindow = toolWindowManager.registerToolWindow(bean.id, new JLabel(), ToolWindowAnchor.fromText(bean.anchor), project,
                                                          false, bean.canCloseContents);
        break;
      }
    }
  }

  ((ProjectViewImpl)ProjectView.getInstance(project)).setupImpl(toolWindow, loadPaneExtensions);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ProjectViewTestUtil.java


示例6: actionPerformed

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  if (e.getData(LangDataKeys.IDE_VIEW) == null) {
    final Project project = e.getData(CommonDataKeys.PROJECT);
    final PsiFileSystemItem psiFile = e.getData(CommonDataKeys.PSI_FILE).getParent();
    ProjectViewImpl.getInstance(project).selectCB(psiFile, psiFile.getVirtualFile(), true).doWhenDone(new Runnable() {
      @Override
      public void run() {
        showPopup(DataManager.getInstance().getDataContext());
      }
    });
  }
  else {
    super.actionPerformed(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:NewElementToolbarAction.java


示例7: actionPerformed

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  if (e.getData(LangDataKeys.IDE_VIEW) == null) {
    final Project project = e.getData(PlatformDataKeys.PROJECT);
    final PsiFileSystemItem psiFile = e.getData(LangDataKeys.PSI_FILE).getParent();
    ProjectViewImpl.getInstance(project).selectCB(psiFile, psiFile.getVirtualFile(), true).doWhenDone(new Runnable() {
      @Override
      public void run() {
        showPopup(DataManager.getInstance().getDataContext());
      }
    });
  }
  else {
    super.actionPerformed(e);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:NewElementToolbarAction.java


示例8: tearDown

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public void tearDown() throws Exception {
  myProjectView.setManualOrder(myPane.getId(), myOriginalManualOrder);
  myProjectView.setSortByType(myPane.getId(), myOriginalSortByType);
  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(myOriginalFoldersAlwaysOnTop);
  myProjectView.removeProjectPane(myPane);

  super.tearDown();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ProjectTreeSortingTest.java


示例9: getWeight

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public int getWeight() {
  final ProjectView projectView = ProjectView.getInstance(myProject);
  if (projectView instanceof ProjectViewImpl && !((ProjectViewImpl)projectView).isFoldersAlwaysOnTop()) {
    return 20;
  }
  return isFQNameShown() ? 70 : 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PsiDirectoryNode.java


示例10: testFoldersOnTop

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public void testFoldersOnTop() throws Exception {
  // first, check with 'sort by type' disabled 
  myProjectView.setSortByType(myPane.getId(), false);

  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(true);
  assertTree("-foldersOnTop\n" +
             " +b.java\n" +
             " +b.txt\n" +
             " a.java\n" +
             " a.txt\n" +
             " c.java\n" +
             " c.txt\n");

  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(false);
  assertTree("-foldersOnTop\n" +
             " a.java\n" +
             " a.txt\n" +
             " +b.java\n" +
             " +b.txt\n" +
             " c.java\n" +
             " c.txt\n");

  // now let's check the behavior, when sortByType is enabled 
  myProjectView.setSortByType(myPane.getId(), true);

  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(true);
  assertTree("-foldersOnTop\n" +
             " +b.java\n" +
             " +b.txt\n" +
             " a.java\n" +
             " c.java\n" +
             " a.txt\n" +
             " c.txt\n");

  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(false);
  assertTree("-foldersOnTop\n" +
             " a.java\n" +
             " +b.java\n" +
             " c.java\n" +
             " a.txt\n" +
             " +b.txt\n"+
             " c.txt\n");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:ProjectTreeSortingTest.java


示例11: testManualOrder

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public void testManualOrder() throws Exception {
  MyOrderProvider provider = new MyOrderProvider(myProject);
  provider.setOrder("b_ordered.java",
                    "a_folder_ordered",
                    "b_ordered.txt",
                    "a_ordered.txt",
                    "b_folder_ordered",
                    "a_ordered.java");
  getProjectTreeStructure().setProviders(provider);

  myProjectView.setManualOrder(myPane.getId(), true);

  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(true);

  myProjectView.setSortByType(myPane.getId(), false);
  assertTree("-manualOrder\n" +
             " b_ordered.java\n" +
             " +a_folder_ordered\n" +
             " b_ordered.txt\n" +
             " a_ordered.txt\n" +
             " +b_folder_ordered\n" +
             " a_ordered.java\n" +

             " +a_folder_unordered\n" +
             " +b_folder_unordered\n" +
             " a_unordered.java\n" +
             " a_unordered.txt\n" +
             " b_unordered.java\n" +
             " b_unordered.txt\n");

  myProjectView.setSortByType(myPane.getId(), true);
  assertTree("-manualOrder\n" +
             " b_ordered.java\n" +
             " +a_folder_ordered\n" +
             " b_ordered.txt\n" +
             " a_ordered.txt\n" +
             " +b_folder_ordered\n" +
             " a_ordered.java\n" +

             " +a_folder_unordered\n" +
             " +b_folder_unordered\n" +
             " a_unordered.java\n" +
             " b_unordered.java\n" +
             " a_unordered.txt\n" +
             " b_unordered.txt\n");

  ((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(false);

  myProjectView.setSortByType(myPane.getId(), false);
  assertTree("-manualOrder\n" +
             " b_ordered.java\n" +
             " +a_folder_ordered\n" +
             " b_ordered.txt\n" +
             " a_ordered.txt\n" +
             " +b_folder_ordered\n" +
             " a_ordered.java\n" +

             " +a_folder_unordered\n" +
             " a_unordered.java\n" +
             " a_unordered.txt\n" +
             " +b_folder_unordered\n" +
             " b_unordered.java\n" +
             " b_unordered.txt\n");

  myProjectView.setSortByType(myPane.getId(), true);
  assertTree("-manualOrder\n" +
             " b_ordered.java\n" +
             " +a_folder_ordered\n" +
             " b_ordered.txt\n" +
             " a_ordered.txt\n" +
             " +b_folder_ordered\n" +
             " a_ordered.java\n" +

             " a_unordered.java\n" +
             " b_unordered.java\n" +
             " a_unordered.txt\n" +
             " b_unordered.txt\n" +
             " +a_folder_unordered\n" +
             " +b_folder_unordered\n");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:81,代码来源:ProjectTreeSortingTest.java


示例12: testAutoscrollFromSourceOnOpening

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public void testAutoscrollFromSourceOnOpening() throws Exception {
  final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory());
  PsiClass psiClass = classes[0];

  FileEditorManager.getInstance(getProject()).openFile(psiClass.getContainingFile().getVirtualFile(), true);

  ProjectView projectView = ProjectView.getInstance(getProject());

  ((ProjectViewImpl)projectView).setAutoscrollFromSource(true, ProjectViewPane.ID);

  ToolWindow toolWindow = ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.PROJECT_VIEW);

  new ProjectViewToolWindowFactory().createToolWindowContent(getProject(), toolWindow);

  projectView.changeView(ProjectViewPane.ID);

  JComponent component = ((ProjectViewImpl)projectView).getComponent();
  DataContext context = DataManager.getInstance().getDataContext(component);
  PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(context);
  assertEquals("Class1.java", ((PsiJavaFile)element).getName());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:NavigateFromSourceTest.java


示例13: configure

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public void configure(@NotNull MavenProject mavenProject, @NotNull Project project, @Nullable Module module) {
  if (module == null) return;

  Element cfg = mavenProject.getPluginConfiguration("com.googlecode", "maven-idea-plugin");
  if (cfg == null) return;

  configureJdk(cfg, module);

  MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project);

  String downloadSources = cfg.getChildTextTrim("downloadSources");
  if (!StringUtil.isEmptyOrSpaces(downloadSources)) {
    projectsManager.getImportingSettings().setDownloadSourcesAutomatically(Boolean.parseBoolean(downloadSources));
  }

  String downloadJavadocs = cfg.getChildTextTrim("downloadJavadocs");
  if (!StringUtil.isEmptyOrSpaces(downloadJavadocs)) {
    projectsManager.getImportingSettings().setDownloadDocsAutomatically(Boolean.parseBoolean(downloadJavadocs));
  }

  String assertNotNull = cfg.getChildTextTrim("assertNotNull");
  if (!StringUtil.isEmptyOrSpaces(assertNotNull)) {
    CompilerConfiguration.getInstance(project).setAddNotNullAssertions(Boolean.parseBoolean(assertNotNull));
  }

  String autoscrollToSource = cfg.getChildTextTrim("autoscrollToSource");
  if (!StringUtil.isEmptyOrSpaces(autoscrollToSource)) {
    ((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollToSource(Boolean.parseBoolean(autoscrollToSource), ProjectViewPane.ID);
  }

  String autoscrollFromSource = cfg.getChildTextTrim("autoscrollFromSource");
  if (!StringUtil.isEmptyOrSpaces(autoscrollFromSource)) {
    ((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollFromSource(Boolean.parseBoolean(autoscrollFromSource), ProjectViewPane.ID);
  }

  String hideEmptyPackages = cfg.getChildTextTrim("hideEmptyPackages");
  if (!StringUtil.isEmptyOrSpaces(hideEmptyPackages)) {
    ProjectView.getInstance(project).setHideEmptyPackages(Boolean.parseBoolean(hideEmptyPackages), ProjectViewPane.ID);
  }

  String optimizeImportsBeforeCommit = cfg.getChildTextTrim("optimizeImportsBeforeCommit");
  if (!StringUtil.isEmptyOrSpaces(optimizeImportsBeforeCommit)) {
    VcsConfiguration.getInstance(module.getProject()).OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(optimizeImportsBeforeCommit);
  }

  String performCodeAnalisisBeforeCommit = cfg.getChildTextTrim("performCodeAnalisisBeforeCommit");
  if (!StringUtil.isEmptyOrSpaces(performCodeAnalisisBeforeCommit)) {
    VcsConfiguration.getInstance(module.getProject()).CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(performCodeAnalisisBeforeCommit);
  }

  String reformatCodeBeforeCommit = cfg.getChildTextTrim("reformatCodeBeforeCommit");
  if (!StringUtil.isEmptyOrSpaces(reformatCodeBeforeCommit)) {
    VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(module.getProject());
    boolean value = Boolean.parseBoolean(reformatCodeBeforeCommit);
    vcsConfiguration.REFORMAT_BEFORE_FILE_COMMIT = value;
    vcsConfiguration.REFORMAT_BEFORE_PROJECT_COMMIT = value;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:60,代码来源:MavenIdeaPluginConfigurer.java


示例14: getWeight

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
public int getWeight() {
  final ProjectView projectView = ProjectView.getInstance(myProject);
  final boolean foldersOnTop = projectView instanceof ProjectViewImpl && !((ProjectViewImpl)projectView).isFoldersAlwaysOnTop();
  return foldersOnTop && getValue().isDirectory() ? 20 : 0; // see PsiDirectoryNode.getWeight()
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:7,代码来源:VirtualFileTreeNode.java


示例15: testAutoscrollFromSourceOnOpening

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public void testAutoscrollFromSourceOnOpening() throws Exception {
  final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory());
  PsiClass psiClass = classes[0];

  FileEditorManager.getInstance(getProject()).openFile(psiClass.getContainingFile().getVirtualFile(), true);

  ProjectView projectView = ProjectView.getInstance(getProject());

  ((ProjectViewImpl)projectView).setAutoscrollFromSource(true, ProjectViewPane.ID);

  ToolWindow toolWindow = ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.PROJECT_VIEW);

  new ProjectViewToolWindowFactory().createToolWindowContent(getProject(), toolWindow);

  projectView.changeView(ProjectViewPane.ID);

  JComponent component = ((ProjectViewImpl)projectView).getComponent();
  DataContext context = DataManager.getInstance().getDataContext(component);
  PsiElement element = LangDataKeys.PSI_ELEMENT.getData(context);
  assertEquals("Class1.java", ((PsiJavaFile)element).getName());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:NavigateFromSourceTest.java


示例16: setUp

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  ((ProjectViewImpl)ProjectView.getInstance(getProject())).setupImpl(null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ProjectViewSwitchingTest.java


示例17: testAutoscrollFromSourceOnOpening

import com.intellij.ide.projectView.impl.ProjectViewImpl; //导入依赖的package包/类
public void testAutoscrollFromSourceOnOpening() throws Exception
{
	final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory());
	PsiClass psiClass = classes[0];

	FileEditorManager.getInstance(getProject()).openFile(psiClass.getContainingFile().getVirtualFile(), true);

	ProjectView projectView = ProjectView.getInstance(getProject());

	((ProjectViewImpl) projectView).setAutoscrollFromSource(true, ProjectViewPane.ID);

	ToolWindow toolWindow = ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.PROJECT_VIEW);

	new ProjectViewToolWindowFactory().createToolWindowContent(getProject(), toolWindow);

	projectView.changeView(ProjectViewPane.ID);

	JComponent component = ((ProjectViewImpl) projectView).getComponent();
	DataContext context = DataManager.getInstance().getDataContext(component);
	PsiElement element = context.getData(LangDataKeys.PSI_ELEMENT);
	assertEquals("Class1.java", ((PsiJavaFile) element).getName());
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:NavigateFromSourceTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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