Java 类com.intellij.openapi.fileTypes.WildcardFileNameMatcher 实例源码

项目:intellij-ce-playground    文件:FileNameMatcherFactoryImpl.java   
@NotNull
public FileNameMatcher createMatcher(@NotNull String pattern) {
  if (pattern.startsWith("*.") &&
      pattern.indexOf('*', 2) < 0 &&
      pattern.indexOf('.', 2) < 0 &&
      pattern.indexOf('?', 2) < 0) {
    return new ExtensionFileNameMatcher(pattern.substring(2).toLowerCase());
  }

  if (pattern.contains("*") || pattern.contains("?")) {
    return new WildcardFileNameMatcher(pattern);
  }

  return new ExactFileNameMatcher(pattern);
}
项目:tools-idea    文件:FileNameMatcherFactoryImpl.java   
@NotNull
public FileNameMatcher createMatcher(@NotNull String pattern) {
  if (pattern.startsWith("*.") &&
      pattern.indexOf('*', 2) < 0 &&
      pattern.indexOf('.', 2) < 0 &&
      pattern.indexOf('?', 2) < 0) {
    return new ExtensionFileNameMatcher(pattern.substring(2).toLowerCase());
  }

  if (pattern.contains("*") || pattern.contains("?")) {
    return new WildcardFileNameMatcher(pattern);
  }

  return new ExactFileNameMatcher(pattern);
}
项目:GoJetPlugin    文件:JetFileTypeFactory.java   
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(JetFileType.INSTANCE, "jet");
    consumer.consume(JetFileType.INSTANCE, new WildcardFileNameMatcher("*.jet.html"));
}