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


Java ProjectManagerEx.getOpenProjects方法代码示例

本文整理汇总了Java中com.intellij.openapi.project.ex.ProjectManagerEx.getOpenProjects方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectManagerEx.getOpenProjects方法的具体用法?Java ProjectManagerEx.getOpenProjects怎么用?Java ProjectManagerEx.getOpenProjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.project.ex.ProjectManagerEx的用法示例。


在下文中一共展示了ProjectManagerEx.getOpenProjects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canExit

import com.intellij.openapi.project.ex.ProjectManagerEx; //导入方法依赖的package包/类
private boolean canExit() {
  for (ApplicationListener applicationListener : myDispatcher.getListeners()) {
    if (!applicationListener.canExitApplication()) {
      return false;
    }
  }

  ProjectManagerEx projectManager = (ProjectManagerEx)ProjectManager.getInstance();
  Project[] projects = projectManager.getOpenProjects();
  for (Project project : projects) {
    if (!projectManager.canClose(project)) {
      return false;
    }
  }

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

示例2: getProject

import com.intellij.openapi.project.ex.ProjectManagerEx; //导入方法依赖的package包/类
private Project getProject() {
  String path = "R:/_github.com/consulo/mssdw";

  try {
    final Project project;
    ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx();
    Project[] openProjects = projectManager.getOpenProjects();
    if (openProjects.length > 0) {
      project = openProjects[0];
    }
    else {
      project = projectManager.loadProject(path);
      projectManager.openTestProject(project);
      final StartupManagerImpl startupManager = (StartupManagerImpl)StartupManager.getInstance(project);
      startupManager.runStartupActivities();
      startupManager.startCacheUpdate();
    }
    return project;
  }
  catch (Exception e) {
    e.getMessage();
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:GwtTransportServiceImpl.java

示例3: tearDown

import com.intellij.openapi.project.ex.ProjectManagerEx; //导入方法依赖的package包/类
@Override
protected void tearDown() throws Exception {
  try {
    if (myFixture != null) {
      try {
        if (CAN_SYNC_PROJECTS) {
          Project project = myFixture.getProject();
          // Since we don't really open the project, but we manually register listeners in the gradle importer
          // by explicitly calling AndroidGradleProjectComponent#configureGradleProject, we need to counteract
          // that here, otherwise the testsuite will leak
          if (Projects.isGradleProject(project)) {
            AndroidGradleProjectComponent projectComponent = ServiceManager.getService(project, AndroidGradleProjectComponent.class);
            projectComponent.projectClosed();
          }
        }
      }
      finally {
        myFixture.tearDown();
        myFixture = null;
      }
    }

    if (CAN_SYNC_PROJECTS) {
      GradleProjectImporter.ourSkipSetupFromTest = false;
    }

    ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx();
    Project[] openProjects = projectManager.getOpenProjects();
    if (openProjects.length > 0) {
      PlatformTestCase.closeAndDisposeProjectAndCheckThatNoOpenProjects(openProjects[0]);
    }
  }
  finally {
    try {
      assertEquals(0, ProjectManager.getInstance().getOpenProjects().length);
    }
    finally {
      super.tearDown();
    }

    // In case other test cases rely on the builtin (incomplete) SDK, restore
    if (ourPreviousSdkData != null) {
      setSdkData(ourPreviousSdkData);
      ourPreviousSdkData = null;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:AndroidGradleTestCase.java


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