本文整理汇总了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;
}
示例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;
}
示例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;
}
}
}