Java 类com.intellij.psi.search.scope.packageSet.FilePatternPackageSet 实例源码

项目:hybris-integration-intellij-idea-plugin    文件:DefaultSearchScopeConfigurator.java   
private NamedScope createScope(final Project project, final String firstGroupName, String secondGroupName) {
    final FilePatternPackageSet firstFilePatternPackageSet = new FilePatternPackageSet(
        SEARCH_SCOPE_GROUP_PREFIX + firstGroupName,
        "*//*"
    );
    final FilePatternPackageSet secondFilePatternPackageSet = new FilePatternPackageSet(
        SEARCH_SCOPE_GROUP_PREFIX + secondGroupName,
        "*//*"
    );
    final UnionPackageSet unionPackageSet = new UnionPackageSet(
        firstFilePatternPackageSet,
        secondFilePatternPackageSet
    );
    return new NamedScope(
        SEARCH_SCOPE_Y_PREFIX + " " + firstGroupName + " " + secondGroupName,
        unionPackageSet
    );
}
项目:hybris-integration-intellij-idea-plugin    文件:DefaultSearchScopeConfigurator.java   
@NotNull
private NamedScope createScope(final Project project, final String groupName) {
    final FilePatternPackageSet filePatternPackageSet = new FilePatternPackageSet(
        SEARCH_SCOPE_GROUP_PREFIX + groupName,
        "*//*"
    );
    return new NamedScope(SEARCH_SCOPE_Y_PREFIX + " " + groupName, filePatternPackageSet);
}
项目:intellij-ce-playground    文件:PatternRegexpConvertorTest.java   
public void testConvertToRegexp() throws Exception {
   assertEquals("a\\.[^\\.]*", FilePatternPackageSet.convertToRegexp("a.*", '.'));
   assertEquals("a\\.(.*\\.)?[^\\.]*", FilePatternPackageSet.convertToRegexp("a..*", '.'));
   assertEquals("a\\/[^\\/]*", FilePatternPackageSet.convertToRegexp("a/*", '/'));
   assertEquals("a\\/.*\\.css", FilePatternPackageSet.convertToRegexp("a/*.css", '/'));
   assertEquals("a\\/(.*\\/)?[^\\/]*", FilePatternPackageSet.convertToRegexp("a//*", '/'));
   assertEquals("[^\\.]*", FilePatternPackageSet.convertToRegexp("*", '.'));
}
项目:tools-idea    文件:PatternRegexpConvertorTest.java   
public void testConvertToRegexp() throws Exception {
   assertEquals("a\\.[^\\.]*", FilePatternPackageSet.convertToRegexp("a.*", '.'));
   assertEquals("a\\.(.*\\.)?[^\\.]*", FilePatternPackageSet.convertToRegexp("a..*", '.'));
   assertEquals("a\\/[^\\/]*", FilePatternPackageSet.convertToRegexp("a/*", '/'));
   assertEquals("a\\/(.*\\/)?[^\\/]*", FilePatternPackageSet.convertToRegexp("a//*", '/'));
   assertEquals("[^\\.]*", FilePatternPackageSet.convertToRegexp("*", '.'));
}
项目:consulo    文件:PatternRegexpConvertorTest.java   
public void testConvertToRegexp() throws Exception {
   assertEquals("a\\.[^\\.]*", FilePatternPackageSet.convertToRegexp("a.*", '.'));
   assertEquals("a\\.(.*\\.)?[^\\.]*", FilePatternPackageSet.convertToRegexp("a..*", '.'));
   assertEquals("a\\/[^\\/]*", FilePatternPackageSet.convertToRegexp("a/*", '/'));
   assertEquals("a\\/(.*\\/)?[^\\/]*", FilePatternPackageSet.convertToRegexp("a//*", '/'));
   assertEquals("[^\\.]*", FilePatternPackageSet.convertToRegexp("*", '.'));
}
项目:intellij-ce-playground    文件:DirectoryNode.java   
public DirectoryNode(VirtualFile aDirectory,
                     Project project,
                     boolean compactPackages,
                     boolean showFQName,
                     VirtualFile baseDir, final VirtualFile[] contentRoots) {
  super(project);
  myVDirectory = aDirectory;
  final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(project);
  final ProjectFileIndex index = projectRootManager.getFileIndex();
  String dirName = aDirectory.getName();
  if (showFQName) {
    final VirtualFile contentRoot = index.getContentRootForFile(myVDirectory);
    if (contentRoot != null) {
      if (Comparing.equal(myVDirectory, contentRoot)) {
        myFQName = dirName;
      }
      else {
        final VirtualFile sourceRoot = index.getSourceRootForFile(myVDirectory);
        if (Comparing.equal(myVDirectory, sourceRoot)) {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
        }
        else if (sourceRoot != null) {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, sourceRoot, '/');
        }
        else {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
        }
      }

      if (contentRoots.length > 1 && ProjectRootsUtil.isModuleContentRoot(myVDirectory, project)) {
        myFQName = getContentRootName(baseDir, myFQName);
      }
    }
    else {
      myFQName = FilePatternPackageSet.getLibRelativePath(myVDirectory, index);
    }
    dirName = myFQName;
  } else {
    if (contentRoots.length > 1 && ProjectRootsUtil.isModuleContentRoot(myVDirectory, project)) {
      dirName = getContentRootName(baseDir, dirName);
    }
  }
  myDirName = dirName;
  myCompactPackages = compactPackages;
}
项目:tools-idea    文件:DirectoryNode.java   
public DirectoryNode(VirtualFile aDirectory,
                     Project project,
                     boolean compactPackages,
                     boolean showFQName,
                     VirtualFile baseDir, final VirtualFile[] contentRoots) {
  super(project);
  myVDirectory = aDirectory;
  final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(project);
  final ProjectFileIndex index = projectRootManager.getFileIndex();
  String dirName = aDirectory.getName();
  if (showFQName) {
    final VirtualFile contentRoot = index.getContentRootForFile(myVDirectory);
    if (contentRoot != null) {
      if (Comparing.equal(myVDirectory, contentRoot)) {
        myFQName = dirName;
      }
      else {
        final VirtualFile sourceRoot = index.getSourceRootForFile(myVDirectory);
        if (Comparing.equal(myVDirectory, sourceRoot)) {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
        }
        else if (sourceRoot != null) {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, sourceRoot, '/');
        }
        else {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
        }
      }

      if (contentRoots.length > 1 && ProjectRootsUtil.isModuleContentRoot(myVDirectory, project)) {
        myFQName = getContentRootName(baseDir, myFQName);
      }
    }
    else {
      myFQName = FilePatternPackageSet.getLibRelativePath(myVDirectory, index);
    }
    dirName = myFQName;
  } else {
    if (contentRoots.length > 1 && ProjectRootsUtil.isModuleContentRoot(myVDirectory, project)) {
      dirName = getContentRootName(baseDir, dirName);
    }
  }
  myDirName = dirName;
  myCompactPackages = compactPackages;
}
项目:consulo    文件:DirectoryNode.java   
public DirectoryNode(VirtualFile aDirectory,
                     Project project,
                     boolean compactPackages,
                     boolean showFQName,
                     VirtualFile baseDir, final VirtualFile[] contentRoots) {
  super(project);
  myVDirectory = aDirectory;
  final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(project);
  final ProjectFileIndex index = projectRootManager.getFileIndex();
  String dirName = aDirectory.getName();
  if (showFQName) {
    final VirtualFile contentRoot = index.getContentRootForFile(myVDirectory);
    if (contentRoot != null) {
      if (Comparing.equal(myVDirectory, contentRoot)) {
        myFQName = dirName;
      }
      else {
        final VirtualFile sourceRoot = index.getSourceRootForFile(myVDirectory);
        if (Comparing.equal(myVDirectory, sourceRoot)) {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
        }
        else if (sourceRoot != null) {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, sourceRoot, '/');
        }
        else {
          myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
        }
      }

      if (contentRoots.length > 1 && ProjectRootsUtil.isModuleContentRoot(myVDirectory, project)) {
        myFQName = getContentRootName(baseDir, myFQName);
      }
    }
    else {
      myFQName = FilePatternPackageSet.getLibRelativePath(myVDirectory, index);
    }
    dirName = myFQName;
  } else {
    if (contentRoots.length > 1 && ProjectRootsUtil.isModuleContentRoot(myVDirectory, project)) {
      dirName = getContentRootName(baseDir, dirName);
    }
  }
  myDirName = dirName;
  myCompactPackages = compactPackages;
}