當前位置: 首頁>>代碼示例>>Java>>正文


Java FileTypeFactory類代碼示例

本文整理匯總了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;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:25,代碼來源:PluginAdvertiserEditorNotificationProvider.java

示例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());
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:11,代碼來源:PluginsAdvertiser.java

示例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());
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:5,代碼來源:PluginAdvertiserEditorNotificationProvider.java


注:本文中的com.intellij.openapi.fileTypes.FileTypeFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。