本文整理汇总了Java中com.intellij.openapi.fileTypes.FileTypeFactory类的典型用法代码示例。如果您正苦于以下问题:Java FileTypeFactory类的具体用法?Java FileTypeFactory怎么用?Java FileTypeFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileTypeFactory类属于com.intellij.openapi.fileTypes包,在下文中一共展示了FileTypeFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNotificationPanel
import com.intellij.openapi.fileTypes.FileTypeFactory; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@Nonnull VirtualFile file, @Nonnull FileEditor fileEditor) {
if (file.getFileType() != PlainTextFileType.INSTANCE && !(file.getFileType() instanceof AbstractFileType)) return null;
final String extension = file.getExtension();
if (extension == null) {
return null;
}
if (myEnabledExtensions.contains(extension) || UnknownFeaturesCollector.getInstance(myProject).isIgnored(createFileFeatureForIgnoring(file))) return null;
UnknownExtension fileFeatureForChecking = new UnknownExtension(FileTypeFactory.FILE_TYPE_FACTORY_EP.getName(), file.getName());
List<IdeaPluginDescriptor> allPlugins = PluginsAdvertiserHolder.getLoadedPluginDescriptors();
Set<IdeaPluginDescriptor> byFeature = PluginsAdvertiser.findByFeature(allPlugins, fileFeatureForChecking);
if (!byFeature.isEmpty()) {
return createPanel(file, byFeature, allPlugins);
}
return null;
}
示例2: isMyFeature
import com.intellij.openapi.fileTypes.FileTypeFactory; //导入依赖的package包/类
private static boolean isMyFeature(String value, UnknownExtension feature) {
if (feature.getExtensionKey().equals(FileTypeFactory.FILE_TYPE_FACTORY_EP.getName())) {
FileNameMatcher matcher = FileNameMatcherFactory.getInstance().createMatcher(value);
return matcher.accept(feature.getValue());
}
else {
return value.equals(feature.getValue());
}
}
示例3: createExtensionFeature
import com.intellij.openapi.fileTypes.FileTypeFactory; //导入依赖的package包/类
private static UnknownFeature createExtensionFeature(String extension) {
return new UnknownFeature(FileTypeFactory.FILE_TYPE_FACTORY_EP.getName(), "File Type", extension);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PluginAdvertiserEditorNotificationProvider.java
示例4: createFileFeatureForIgnoring
import com.intellij.openapi.fileTypes.FileTypeFactory; //导入依赖的package包/类
@Nonnull
private static UnknownExtension createFileFeatureForIgnoring(VirtualFile virtualFile) {
return new UnknownExtension(FileTypeFactory.FILE_TYPE_FACTORY_EP.getName(), "*." + virtualFile.getExtension());
}