Package com.intellij.openapi.roots

Examples of com.intellij.openapi.roots.ContentEntry


        String moduleRootPath = getContentEntryPath();
        if (moduleRootPath != null) {
            LocalFileSystem localFileSystem = LocalFileSystem.getInstance();
            VirtualFile moduleContentRoot = localFileSystem.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(moduleRootPath));
            if (moduleContentRoot != null) {
                ContentEntry contentEntry = rootModel.addContentEntry(moduleContentRoot);
                List<Pair<String, String>> sourcePaths = getSourcePaths();
                if (sourcePaths != null) {
                    for (Pair<String, String> sourcePath : sourcePaths) {
                        VirtualFile sourceRoot = localFileSystem.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(sourcePath.first));
                        if (sourceRoot != null) {
                            contentEntry.addSourceFolder(sourceRoot, false, sourcePath.second);
                        }
                    }
                }
            }
        }
View Full Code Here


    myFixture.addFileToProject("dir2/example/web/sub/foo.dart", "");

    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      public void run() {
        final ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
        final ContentEntry contentEntry = model.getContentEntries()[0];
        contentEntry.addExcludeFolder(rootUrl + "/dir1/someFolder");
        contentEntry.addExcludeFolder(rootUrl + "/dir1/packages/project1");
        contentEntry.addExcludeFolder(rootUrl + "/dir1/web/packages");
        contentEntry.addExcludeFolder(rootUrl + "/dir2/packages/oldProject2Name");
        contentEntry.addExcludeFolder(rootUrl + "/dir2/someFolder");
        contentEntry.addExcludeFolder(rootUrl + "/dir2/lib/someFolder");
        contentEntry.addExcludeFolder(rootUrl + "/dir2/example/nonexistent/packages");
        contentEntry.addExcludeFolder(rootUrl + "/dir2/example/packages/oldProject3Name");
        model.commit();
      }
    });

    DartProjectComponent.excludeBuildAndPackagesFolders(myModule, pubspec2);
View Full Code Here

        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            @Override
            public void run() {
                //Add the default content entry
                VirtualFile baseDir = project.getBaseDir();
                ContentEntry entry = mrm.addContentEntry(baseDir);

                //Set src-folder as SourceFolder, if it exists
                VirtualFile srcFolder = baseDir.findFileByRelativePath("src");
                if(srcFolder != null) {
                    entry.addSourceFolder(srcFolder, false);
                }

                mrm.commit();
                moduleModel.commit();
            }
View Full Code Here

    return new File(myTempDirectory, getTestDirectoryName());
  }

  private void setupContentRoot() {
    ModifiableRootModel modifiableModel = ModuleRootManager.getInstance(myModule).getModifiableModel();
    ContentEntry contentEntry = modifiableModel.addContentEntry(getContentRoot());
    VirtualFile src = getContentRoot().findChild("src");
    if (src != null) {
      contentEntry.addSourceFolder(src, false);
    }
    modifiableModel.commit();
  }
View Full Code Here

    VirtualFile ext_src = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(testDir + "/ext_src"));
    final ModuleRootManager rootManager = ModuleRootManager.getInstance(myModule);
    final ModifiableRootModel rootModel = rootManager.getModifiableModel();
    rootModel.clear();
    // configure source and output path
    final ContentEntry contentEntry = rootModel.addContentEntry(projectDir);
    contentEntry.addSourceFolder(sourceDir[0], false);
    if (ext_src != null) {
      contentEntry.addSourceFolder(ext_src, false);
    }

    // IMPORTANT! The jdk must be obtained in a way it is obtained in the normal program!
    //ProjectJdkEx jdk = ProjectJdkTable.getInstance().getInternalJdk();
    ProjectJdk jdk;
View Full Code Here

      assertTrue(dir.exists());

      VirtualFile vDir = LocalFileSystem.getInstance().
          refreshAndFindFileByPath(dir.getCanonicalPath().replace(File.separatorChar, '/'));
      assertNotNull(vDir);
      ContentEntry contentEntry = rootModel.addContentEntry(vDir);
      contentEntry.addSourceFolder(vDir, false);
    }

    // Add Clojure Library
    OrderEnumerator libs = rootManager.orderEntries().librariesOnly();
    final List<Library.ModifiableModel> libModels = new ArrayList<Library.ModifiableModel>();
View Full Code Here

    final String moduleRootPath = getContentEntryPath();
    if (moduleRootPath != null) {
      final LocalFileSystem lfs = LocalFileSystem.getInstance();
      VirtualFile moduleContentRoot = lfs.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(moduleRootPath));
      if (moduleContentRoot != null) {
        final ContentEntry contentEntry = rootModel.addContentEntry(moduleContentRoot);
        final List<Pair<String,String>> sourcePaths = getSourcePaths();
        if (sourcePaths != null) {
          for (final Pair<String, String> sourcePath : sourcePaths) {
            final VirtualFile sourceRoot = lfs.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(sourcePath.first));
            if (sourceRoot != null) {
              contentEntry.addSourceFolder(sourceRoot, false, sourcePath.second);
            }
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.roots.ContentEntry

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.