本文整理匯總了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());
}