Package com.intellij.openapi.application

Examples of com.intellij.openapi.application.WriteAction


          final String packagePath = packageName.replace('.', '/');
          final String path = sourceRoot != null ? sourceRoot.getPath() : directory.getPath();
          // ToDo: I shouldn't create directories, only create VirtualFile object.
          final Ref<PsiDirectory> resultRef = new Ref<PsiDirectory>();
          new WriteAction() {
            protected void run(@NotNull Result result) throws Throwable {
              final VirtualFile packageFile = VfsUtil.createDirectoryIfMissing(path + '/' + packagePath);
              if (packageFile != null) {
                resultRef.set(PsiDirectoryFactory.getInstance(project).createDirectory(packageFile));
              }
View Full Code Here


    return projectDir;
  }

  public static void loadModules(String projectName, final Project project, String projectDirPath) throws Exception {
    final File projectDir = extractProject(projectName, projectDirPath);
    new WriteAction() {
      @Override
      protected void run(@NotNull Result result) throws Throwable {
        VirtualFile virtualDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(projectDir);
        assertNotNull("Directory not found: " + projectDir, virtualDir);
        virtualDir.refresh(false, true);
View Full Code Here

     * @param isTestSource Indicate if this is a test directory
     */
    protected void addSourceFoldersToContentEntry(final ContentEntry contentEntry, final List<String> paths, final boolean isTestSource) {

        for (final String path : paths) {
            new WriteAction() {
                @Override
                protected void run(Result result) throws Throwable {
                    VirtualFile directory = LocalFileSystem.getInstance().refreshAndFindFileByPath(path);
                    if (directory != null) {
                        contentEntry.addSourceFolder(directory, isTestSource);
View Full Code Here

     * @return The compiler extension updated with the given settings.
     */
    public CompilerModuleExtension updateCompilePath(final CompilerModuleExtension extension, Map leinProjectMap) {

        final String outputPathString = (String) leinProjectMap.get(LEIN_COMPILE_PATH);
        new WriteAction() {
            @Override
            protected void run(Result result) throws Throwable {
                try {
                    VirtualFile outputPath = VfsUtil.createDirectoryIfMissing(outputPathString);
                    extension.inheritCompilerOutputPath(false);
View Full Code Here

        //Load all the dependencies from the project file
        List dependencyMaps = LeiningenAPI.loadDependencies(leinProjectFile.getCanonicalPath());
        final List<LibraryInfo> dependencies = initializeDependencies(module, projectLibraries,dependencyMaps);

        new WriteAction() {
            @Override
            protected void run(Result result) throws Throwable {

                for (LibraryInfo library : dependencies) {
                    library.modifiableModel.commit();
View Full Code Here

TOP

Related Classes of com.intellij.openapi.application.WriteAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.