本文整理匯總了Java中com.intellij.openapi.fileTypes.FileType.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java FileType.equals方法的具體用法?Java FileType.equals怎麽用?Java FileType.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.fileTypes.FileType
的用法示例。
在下文中一共展示了FileType.equals方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canPutAt
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
@Override
public boolean canPutAt(@NotNull VirtualFile file, int line, @NotNull Project project)
{
final Document document = FileDocumentManager.getInstance().getDocument(file);
if (document != null)
{
final PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
if (psiFile != null)
{
final FileType fileType = psiFile.getFileType();
if (fileType.equals(WeaveFileType.getInstance()))
{
return WeavePsiUtils.getFirstWeaveElement(project, document, line) != null;
}
}
}
return false;
}
示例2: getFiles
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
@NotNull
public VirtualFile[] getFiles(final FileType fileType, boolean inSourceOnly) {
final List<VirtualFile> files = new ArrayList<VirtualFile>();
for (Iterator<VirtualFile> it = myRootFiles.iterator(); it.hasNext();) {
VirtualFile file = it.next();
if (!file.isValid()) {
it.remove();
continue;
}
if (file.isDirectory()) {
addRecursively(files, file, fileType);
}
else {
if (fileType == null || fileType.equals(file.getFileType())) {
files.add(file);
}
}
}
return VfsUtilCore.toVirtualFileArray(files);
}
示例3: buildDialog
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
@Override
protected void buildDialog(Project project, PsiDirectory directory, CreateFileFromTemplateDialog.Builder builder) {
builder
.setTitle(GroovyBundle.message("newclass.dlg.title"))
.addKind("Class", JetgroovyIcons.Groovy.Class, GroovyTemplates.GROOVY_CLASS)
.addKind("Interface", JetgroovyIcons.Groovy.Interface, GroovyTemplates.GROOVY_INTERFACE);
if (GroovyConfigUtils.getInstance().isVersionAtLeast(directory, GroovyConfigUtils.GROOVY2_3, true)) {
builder.addKind("Trait", JetgroovyIcons.Groovy.Trait, GroovyTemplates.GROOVY_TRAIT);
}
builder
.addKind("Enum", JetgroovyIcons.Groovy.Enum, GroovyTemplates.GROOVY_ENUM)
.addKind("Annotation", JetgroovyIcons.Groovy.AnnotationType, GroovyTemplates.GROOVY_ANNOTATION);
for (FileTemplate template : FileTemplateManager.getInstance(project).getAllTemplates()) {
FileType fileType = FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(template.getExtension());
if (fileType.equals(GroovyFileType.GROOVY_FILE_TYPE) && JavaDirectoryService.getInstance().getPackage(directory) != null) {
builder.addKind(template.getName(), JetgroovyIcons.Groovy.Class, template.getName());
}
}
}
示例4: createFileTypeConfigurable
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
public static Configurable createFileTypeConfigurable(Project project, FileType fileType, TemplateCommentPanel parentPanel) {
if (fileType.equals(StdFileTypes.JAVA)) {
return new TemplateCommentPanel(fileType, parentPanel, new String[]{"Before Package", "Before Imports", "Before Class"}, project);
}
else if (fileType.equals(StdFileTypes.XML)) {
return new TemplateCommentPanel(fileType, parentPanel, LOCATIONS_IN_FILE, project);
}
else if (fileType.equals(StdFileTypes.HTML)) {
return new TemplateCommentPanel(fileType, parentPanel, LOCATIONS_IN_FILE, project);
}
else if (fileType.equals(StdFileTypes.JSP)) {
return new TemplateCommentPanel(fileType, parentPanel, LOCATIONS_IN_FILE, project);
}
else if (fileType.equals(StdFileTypes.JSPX)) {
return new TemplateCommentPanel(fileType, parentPanel, LOCATIONS_IN_FILE, project);
}
else {
return new TemplateCommentPanel(fileType, parentPanel, null, project);
}
}
示例5: getBreakpointAware
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
@Nullable
public static JavaScriptDebugAware getBreakpointAware(@NotNull FileType fileType) {
for (JavaScriptDebugAware debugAware : EP_NAME.getExtensions()) {
if (debugAware.getBreakpointTypeClass() == null && fileType.equals(debugAware.getFileType())) {
return debugAware;
}
}
return null;
}
示例6: contains
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
@Override
public boolean contains(@NotNull VirtualFile file) {
if (!super.contains(file)) return false;
final FileType fileType = file.getFileType();
for (FileType otherFileType : myFileTypes) {
if (fileType.equals(otherFileType)) return true;
}
return false;
}
示例7: createUpdateCopyright
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
private static UpdateCopyright createUpdateCopyright(Project project, Module module, VirtualFile file,
FileType base, CopyrightProfile options)
{
if (base == null || file == null)
{
return null;
}
// NOTE - any changes here require changes to LanguageOptionsFactory and ConfigTabFactory
FileType type = FileTypeUtil.getInstance().getFileTypeByType(base);
logger.debug("file=" + file);
logger.debug("type=" + type.getName());
if (type.equals(StdFileTypes.PROPERTIES))
{
return new UpdatePropertiesFileCopyright(project, module, file, options);
}
else if ("JavaScript".equals(type.getName()))
{
return new UpdateJavaScriptFileCopyright(project, module, file, options);
}
else
{
return CopyrightUpdaters.INSTANCE.forFileType(type).createInstance(project, module, file, type, options);
}
}
示例8: handlesTemplate
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
public boolean handlesTemplate(final FileTemplate template) {
FileType fileType = FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(template.getExtension());
return fileType.equals(StdFileTypes.JAVA) && !FileTemplateUtil.INTERNAL_PACKAGE_INFO_TEMPLATE_NAME.equals(template.getName());
}
示例9: canCreateFromTemplate
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
public static boolean canCreateFromTemplate (PsiDirectory[] dirs, FileTemplate template) {
FileType fileType = FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(template.getExtension());
if (fileType.equals(FileTypes.UNKNOWN)) return false;
CreateFromTemplateHandler handler = findHandler(template);
return handler.canCreate(dirs);
}
示例10: isTemplateOfType
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
@Override
public boolean isTemplateOfType(@NotNull final FileType fType) {
return fType.equals(FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(getExtension()));
}
示例11: handlesTemplate
import com.intellij.openapi.fileTypes.FileType; //導入方法依賴的package包/類
public boolean handlesTemplate(final FileTemplate template) {
FileType fileType = FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(template.getExtension());
return fileType.equals(StdFileTypes.GUI_DESIGNER_FORM);
}