本文整理匯總了Java中com.intellij.openapi.fileTypes.FileTypeManager.isFileIgnored方法的典型用法代碼示例。如果您正苦於以下問題:Java FileTypeManager.isFileIgnored方法的具體用法?Java FileTypeManager.isFileIgnored怎麽用?Java FileTypeManager.isFileIgnored使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.fileTypes.FileTypeManager
的用法示例。
在下文中一共展示了FileTypeManager.isFileIgnored方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isJavaSourceFile
import com.intellij.openapi.fileTypes.FileTypeManager; //導入方法依賴的package包/類
public static boolean isJavaSourceFile(@NotNull Project project, @NotNull VirtualFile file) {
FileTypeManager fileTypeManager = FileTypeManager.getInstance();
if (file.isDirectory() || file.getFileType() != StdFileTypes.JAVA || fileTypeManager.isFileIgnored(file)) {
return false;
}
ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
return fileIndex.isUnderSourceRootOfType(file, JavaModuleSourceRootTypes.SOURCES) || fileIndex.isInLibrarySource(file);
}
示例2: accept
import com.intellij.openapi.fileTypes.FileTypeManager; //導入方法依賴的package包/類
public boolean accept(File file) {
final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
final String name = file.getName();
return !fileTypeManager.isFileIgnored(name)
&& fileTypeManager.getFileTypeByFileName(name) != StdFileTypes.IDEA_PROJECT
&& fileTypeManager.getFileTypeByFileName(name) != StdFileTypes.IDEA_MODULE
&& fileTypeManager.getFileTypeByFileName(name) != StdFileTypes.IDEA_WORKSPACE
;
}
示例3: isIgnoredOrUnderIgnoredDirectory
import com.intellij.openapi.fileTypes.FileTypeManager; //導入方法依賴的package包/類
private static boolean isIgnoredOrUnderIgnoredDirectory(final VirtualFile file) {
if (isIgnoredByBuild(file)) {
return true;
}
final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
VirtualFile current = file.getParent();
while (current != null) {
if (fileTypeManager.isFileIgnored(current)) {
return true;
}
current = current.getParent();
}
return false;
}
示例4: createFileCopyWithNewName
import com.intellij.openapi.fileTypes.FileTypeManager; //導入方法依賴的package包/類
@Nullable
private PsiFile createFileCopyWithNewName(VirtualFile vFile, String name) {
// TODO[ik] remove this. Event handling and generation must be in view providers mechanism since we
// need to track changes in _all_ psi views (e.g. namespace changes in XML)
final FileTypeManager instance = FileTypeManager.getInstance();
if(instance.isFileIgnored(name)) return null;
final FileType fileTypeByFileName = instance.getFileTypeByFileName(name);
final Document document = FileDocumentManager.getInstance().getDocument(vFile);
return PsiFileFactory.getInstance(myManager.getProject()).createFileFromText(name, fileTypeByFileName,
document != null ? document.getCharsSequence() : "", vFile.getModificationStamp(),
true, false);
}
示例5: createFilter
import com.intellij.openapi.fileTypes.FileTypeManager; //導入方法依賴的package包/類
private static FileFilter createFilter(final ProgressIndicator progressIndicator, @Nullable final FileTypeManager fileTypeManager) {
return new FileFilter() {
public boolean accept(File pathName) {
if (progressIndicator != null) {
progressIndicator.setText2("");
}
return fileTypeManager == null || !fileTypeManager.isFileIgnored(FileUtil.toSystemIndependentName(pathName.getName()));
}
};
}
示例6: isSchemaSourceFile
import com.intellij.openapi.fileTypes.FileTypeManager; //導入方法依賴的package包/類
@Contract("_, null -> false")
public static boolean isSchemaSourceFile(@NotNull Project project, @Nullable VirtualFile file) {
if (file == null) return false;
FileTypeManager fileTypeManager = FileTypeManager.getInstance();
if (file.isDirectory() || fileTypeManager.isFileIgnored(file)) {
return false;
}
return fileUnderSources(project, file);
}