/platform/platform-impl/src/com/intellij/openapi/project/ex/ProjectManagerEx.java

https://bitbucket.org/nbargnesi/idea · Java · 61 lines · 32 code · 13 blank · 16 comment · 0 complexity · 15371d9e7ca8b53ea3c42fb7eab2a3ce MD5 · raw file

  1. /*
  2. * Copyright 2000-2011 JetBrains s.r.o.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.intellij.openapi.project.ex;
  17. import com.intellij.openapi.application.ApplicationManager;
  18. import com.intellij.openapi.project.Project;
  19. import com.intellij.openapi.project.ProjectManager;
  20. import com.intellij.openapi.util.InvalidDataException;
  21. import com.intellij.openapi.vfs.VirtualFile;
  22. import org.jdom.JDOMException;
  23. import org.jetbrains.annotations.NotNull;
  24. import org.jetbrains.annotations.Nullable;
  25. import org.jetbrains.annotations.TestOnly;
  26. import java.io.IOException;
  27. public abstract class ProjectManagerEx extends ProjectManager {
  28. public static ProjectManagerEx getInstanceEx() {
  29. return (ProjectManagerEx)ApplicationManager.getApplication().getComponent(ProjectManager.class);
  30. }
  31. @Nullable
  32. public abstract Project newProject(final String projectName, String filePath, boolean useDefaultProjectSettings, boolean isDummy);
  33. @Nullable
  34. public abstract Project loadProject(String filePath) throws IOException, JDOMException, InvalidDataException;
  35. public abstract boolean openProject(Project project);
  36. public abstract boolean isProjectOpened(Project project);
  37. public abstract boolean canClose(Project project);
  38. public abstract void saveChangedProjectFile(VirtualFile file, final Project project);
  39. public abstract boolean isFileSavedToBeReloaded(VirtualFile file);
  40. public abstract void blockReloadingProjectOnExternalChanges();
  41. public abstract void unblockReloadingProjectOnExternalChanges();
  42. @TestOnly
  43. public abstract void openTestProject(@NotNull Project project);
  44. @TestOnly
  45. public abstract void closeTestProject(@NotNull Project project);
  46. // returns true on success
  47. public abstract boolean closeAndDispose(@NotNull Project project);
  48. }