• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ExactFileNameMatcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.fileTypes.ExactFileNameMatcher的典型用法代码示例。如果您正苦于以下问题:Java ExactFileNameMatcher类的具体用法?Java ExactFileNameMatcher怎么用?Java ExactFileNameMatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExactFileNameMatcher类属于com.intellij.openapi.fileTypes包,在下文中一共展示了ExactFileNameMatcher类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: findAssociatedFileType

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@Nullable
public T findAssociatedFileType(@NotNull FileNameMatcher matcher) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    return myExtensionMappings.get(((ExtensionFileNameMatcher)matcher).getExtension());
  }

  if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;

    Map<CharSequence, T> mapToUse = exactFileNameMatcher.isIgnoreCase() ? myExactFileNameAnyCaseMappings : myExactFileNameMappings;
    return mapToUse.get(exactFileNameMatcher.getFileName());
  }

  for (Pair<FileNameMatcher, T> mapping : myMatchingMappings) {
    if (matcher.equals(mapping.getFirst())) return mapping.getSecond();
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FileTypeAssocTable.java


示例2: addAssociation

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public void addAssociation(FileNameMatcher matcher, T type) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    myExtensionMappings.put(((ExtensionFileNameMatcher)matcher).getExtension(), type);
  }
  else if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;

    if (exactFileNameMatcher.isIgnoreCase()) {
      myExactFileNameAnyCaseMappings.put(exactFileNameMatcher.getFileName(), type);
    } else {
      myExactFileNameMappings.put(exactFileNameMatcher.getFileName(), type);
    }
  } else {
    myMatchingMappings.add(new Pair<FileNameMatcher, T>(matcher, type));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:FileTypeAssocTable.java


示例3: findAssociatedFileType

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@Nullable
public T findAssociatedFileType(final FileNameMatcher matcher) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    return myExtensionMappings.get(((ExtensionFileNameMatcher)matcher).getExtension());
  }

  if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;

    if (exactFileNameMatcher.isIgnoreCase()) {
      return myExactFileNameAnyCaseMappings.get(exactFileNameMatcher.getFileName());
    } else {
      return myExactFileNameMappings.get(exactFileNameMatcher.getFileName());
    }
  }

  for (Pair<FileNameMatcher, T> mapping : myMatchingMappings) {
    if (matcher.equals(mapping.getFirst())) return mapping.getSecond();
  }

  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:FileTypeAssocTable.java


示例4: associateFileType

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
/**
 * Associates given file with proper {@link IgnoreFileType}.
 *
 * @param fileName to associate
 * @param fileType file type to bind with pattern
 */
public static void associateFileType(@NotNull final String fileName, @NotNull final IgnoreFileType fileType) {
    final Application application = ApplicationManager.getApplication();
    if (application.isDispatchThread()) {
        final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
        application.invokeLater(new Runnable() {
            @Override
            public void run() {
                application.runWriteAction(new Runnable() {
                    @Override
                    public void run() {
                        fileTypeManager.associate(fileType, new ExactFileNameMatcher(fileName));
                        FILE_TYPES_ASSOCIATION_QUEUE.remove(fileName);
                    }
                });
            }
        }, ModalityState.NON_MODAL);
    } else if (!FILE_TYPES_ASSOCIATION_QUEUE.containsKey(fileName)) {
        FILE_TYPES_ASSOCIATION_QUEUE.put(fileName, fileType);
    }
}
 
开发者ID:hsz,项目名称:idea-gitignore,代码行数:27,代码来源:IgnoreManager.java


示例5: createMatcher

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:FileNameMatcherFactoryImpl.java


示例6: isAssociatedWith

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public boolean isAssociatedWith(@NotNull T type, @NotNull FileNameMatcher matcher) {
  if (matcher instanceof ExtensionFileNameMatcher || matcher instanceof ExactFileNameMatcher) {
    return findAssociatedFileType(matcher) == type;
  }

  for (Pair<FileNameMatcher, T> mapping : myMatchingMappings) {
    if (matcher.equals(mapping.getFirst()) && type == mapping.getSecond()) return true;
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FileTypeAssocTable.java


示例7: addAssociation

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public void addAssociation(FileNameMatcher matcher, T type) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    myExtensionMappings.put(((ExtensionFileNameMatcher)matcher).getExtension(), type);
  }
  else if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;

    Map<CharSequence, T> mapToUse = exactFileNameMatcher.isIgnoreCase() ? myExactFileNameAnyCaseMappings : myExactFileNameMappings;
    mapToUse.put(exactFileNameMatcher.getFileName(), type);
  }
  else {
    myMatchingMappings.add(Pair.create(matcher, type));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:FileTypeAssocTable.java


示例8: removeAssociation

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
boolean removeAssociation(@NotNull FileNameMatcher matcher, @NotNull T type) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    String extension = ((ExtensionFileNameMatcher)matcher).getExtension();
    if (myExtensionMappings.get(extension) == type) {
      myExtensionMappings.remove(extension);
      return true;
    }
    return false;
  }

  if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;
    String fileName = exactFileNameMatcher.getFileName();

    final Map<CharSequence, T> mapToUse = exactFileNameMatcher.isIgnoreCase() ? myExactFileNameAnyCaseMappings : myExactFileNameMappings;
    if(mapToUse.get(fileName) == type) {
      mapToUse.remove(fileName);
      return true;
    }
    return false;
  }

  List<Pair<FileNameMatcher, T>> copy = new ArrayList<Pair<FileNameMatcher, T>>(myMatchingMappings);
  for (Pair<FileNameMatcher, T> assoc : copy) {
    if (matcher.equals(assoc.getFirst())) {
      myMatchingMappings.remove(assoc);
      return true;
    }
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FileTypeAssocTable.java


示例9: isAssociatedWith

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public boolean isAssociatedWith(T type, FileNameMatcher matcher) {
  if (matcher instanceof ExtensionFileNameMatcher || matcher instanceof ExactFileNameMatcher) {
    return findAssociatedFileType(matcher) == type;
  }

  for (Pair<FileNameMatcher, T> mapping : myMatchingMappings) {
    if (matcher.equals(mapping.getFirst()) && type == mapping.getSecond()) return true;
  }

  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:FileTypeAssocTable.java


示例10: removeAssociation

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public boolean removeAssociation(FileNameMatcher matcher, T type) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    String extension = ((ExtensionFileNameMatcher)matcher).getExtension();
    if (myExtensionMappings.get(extension) == type) {
      myExtensionMappings.remove(extension);
      return true;
    }
    return false;
  }

  if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;
    final Map<String, T> mapToUse;
    String fileName = exactFileNameMatcher.getFileName();

    if (exactFileNameMatcher.isIgnoreCase()) {
      mapToUse = myExactFileNameAnyCaseMappings;
    } else {
      mapToUse = myExactFileNameMappings;
    }
    if(mapToUse.get(fileName) == type) {
      mapToUse.remove(fileName);
      return true;
    }
    return false;
  }

  List<Pair<FileNameMatcher, T>> copy = new ArrayList<Pair<FileNameMatcher, T>>(myMatchingMappings);
  for (Pair<FileNameMatcher, T> assoc : copy) {
    if (matcher.equals(assoc.getFirst())) {
      myMatchingMappings.remove(assoc);
      return true;
    }
  }

  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:38,代码来源:FileTypeAssocTable.java


示例11: removeAssociation

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public boolean removeAssociation(FileNameMatcher matcher, T type) {
  if (matcher instanceof ExtensionFileNameMatcher) {
    String extension = ((ExtensionFileNameMatcher)matcher).getExtension();
    if (myExtensionMappings.get(extension) == type) {
      myExtensionMappings.remove(extension);
      return true;
    }
    return false;
  }

  if (matcher instanceof ExactFileNameMatcher) {
    final ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher;
    final Map<CharSequence, T> mapToUse;
    String fileName = exactFileNameMatcher.getFileName();

    if (exactFileNameMatcher.isIgnoreCase()) {
      mapToUse = myExactFileNameAnyCaseMappings;
    } else {
      mapToUse = myExactFileNameMappings;
    }
    if(mapToUse.get(fileName) == type) {
      mapToUse.remove(fileName);
      return true;
    }
    return false;
  }

  List<Pair<FileNameMatcher, T>> copy = new ArrayList<Pair<FileNameMatcher, T>>(myMatchingMappings);
  for (Pair<FileNameMatcher, T> assoc : copy) {
    if (matcher.equals(assoc.getFirst())) {
      myMatchingMappings.remove(assoc);
      return true;
    }
  }

  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:FileTypeAssocTable.java


示例12: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(CoffigYamlFileType.INSTANCE, new ExactFileNameMatcher("application.yaml"), new ExactFileNameMatcher("application.yml"));
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:5,代码来源:CoffigYamlFileTypeFactory.java


示例13: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(StylintConfigFileType.INSTANCE, new ExactFileNameMatcher(StylintConfigFileType.STYLINTRC));
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:4,代码来源:StylintConfigFileTypeFactory.java


示例14: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public void createFileTypes(final @NotNull FileTypeConsumer consumer) {
  consumer.consume(BuildoutCfgFileType.INSTANCE, new ExactFileNameMatcher(BuildoutFacet.BUILDOUT_CFG, true));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BuildoutCfgFileTypeFactory.java


示例15: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
  consumer.consume(PlainTextFileType.INSTANCE, new ExactFileNameMatcher(".gitignore"), new ExactFileNameMatcher(".gitmodules"));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GitFileTypeFactory.java


示例16: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
  ExactFileNameMatcher matcher = new ExactFileNameMatcher(GroovyExtensionProvider.ORG_CODEHAUS_GROOVY_RUNTIME_EXTENSION_MODULE,
                                                          !SystemInfo.isFileSystemCaseSensitive);
  consumer.consume(PropertiesFileType.INSTANCE, matcher);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:DGMFileTypeFactory.java


示例17: buildLanguageFileTypeMatchers

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@Override
public ImmutableList<FileNameMatcher> buildLanguageFileTypeMatchers() {
  return ImmutableList.of(
      new ExactFileNameMatcher("BUILD"), new ExactFileNameMatcher("BUILD.bazel"),
      new ExtensionFileNameMatcher("bzl"), new ExactFileNameMatcher("WORKSPACE"));
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:7,代码来源:BazelBuildSystemProvider.java


示例18: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(CoffeeLintConfigFileType.INSTANCE, new ExactFileNameMatcher(CoffeeLintConfigFileType.COFFEE_LINT_CONFIG));
}
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:4,代码来源:CoffeeLintConfigFileTypeFactory.java


示例19: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
        consumer.consume(ESLintConfigFileType.INSTANCE, new ExactFileNameMatcher(ESLintConfigFileType.ESLINTRC));
//                new ExtensionFileNameMatcher(ESLintConfigFileType.ESLINTRC), new ExactFileNameMatcher("eslint.json"));
    }
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:5,代码来源:ESLintConfigFileTypeFactory.java


示例20: createFileTypes

import com.intellij.openapi.fileTypes.ExactFileNameMatcher; //导入依赖的package包/类
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(LombokConfigFileType.INSTANCE, new ExactFileNameMatcher("lombok.config"));
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:5,代码来源:LombokConfigFileTypeFactory.java



注:本文中的com.intellij.openapi.fileTypes.ExactFileNameMatcher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IElementType类代码示例发布时间:2022-05-22
下一篇:
Java Hack类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap