• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VFileProperty类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.vfs.VFileProperty的典型用法代码示例。如果您正苦于以下问题:Java VFileProperty类的具体用法?Java VFileProperty怎么用?Java VFileProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VFileProperty类属于com.intellij.openapi.vfs包,在下文中一共展示了VFileProperty类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isFileSelectable

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
/**
 * Defines whether a file can be chosen.
 */
public boolean isFileSelectable(VirtualFile file) {
  if (file == null) return false;

  if (file.is(VFileProperty.SYMLINK) && file.getCanonicalPath() == null) {
    return false;
  }
  if (file.isDirectory() && myChooseFolders) {
    return true;
  }
  if (acceptAsJarFile(file)) {
    return true;
  }
  if (acceptAsGeneralFile(file)) {
    return true;
  }
  if (myFileFilter != null && !file.isDirectory() && myFileFilter.value(file)) {
    return true;
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FileChooserDescriptor.java


示例2: checkAndScheduleFileTypeChange

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
private boolean checkAndScheduleFileTypeChange(@NotNull VirtualFile parent,
                                               @NotNull VirtualFile child,
                                               @NotNull FileAttributes childAttributes) {
  boolean currentIsDirectory = child.isDirectory();
  boolean currentIsSymlink = child.is(VFileProperty.SYMLINK);
  boolean currentIsSpecial = child.is(VFileProperty.SPECIAL);
  boolean upToDateIsDirectory = childAttributes.isDirectory();
  boolean upToDateIsSymlink = childAttributes.isSymLink();
  boolean upToDateIsSpecial = childAttributes.isSpecial();

  if (currentIsDirectory != upToDateIsDirectory || currentIsSymlink != upToDateIsSymlink || currentIsSpecial != upToDateIsSpecial) {
    scheduleDeletion(child);
    scheduleCreation(parent, child.getName(), upToDateIsDirectory, true);
    return true;
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:RefreshWorker.java


示例3: createFile

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Nullable
protected PsiFile createFile(@NotNull Project project, @NotNull VirtualFile file, @NotNull FileType fileType) {
  if (fileType.isBinary() || file.is(VFileProperty.SPECIAL)) {
    return new PsiBinaryFileImpl((PsiManagerImpl)getManager(), this);
  }
  if (!isTooLargeForIntelligence(file)) {
    final PsiFile psiFile = createFile(getBaseLanguage());
    if (psiFile != null) return psiFile;
  }

  if (isTooLargeForContentLoading(file)) {
    return new PsiLargeFileImpl((PsiManagerImpl)getManager(), this);
  }

  return new PsiPlainTextFileImpl(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SingleRootFileViewProvider.java


示例4: processFile

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
public boolean processFile(NewVirtualFile file) {
  if (file.isDirectory() || file.is(VFileProperty.SPECIAL)) {
    return true;
  }
  try {
    DataInputStream stream = FSRecords.readContent(file.getId());
    if (stream == null) return true;
    byte[] bytes = FileUtil.loadBytes(stream);
    totalSize.addAndGet(bytes.length);
    count.incrementAndGet();
    ProgressManager.getInstance().getProgressIndicator().setText(file.getPresentableUrl());
  }
  catch (IOException e) {
    LOG.error(e);
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:LoadAllVfsStoredContentsAction.java


示例5: patchIcon

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
protected Icon patchIcon(Icon original, VirtualFile file) {
  Icon icon = original;

  final Bookmark bookmarkAtFile = BookmarkManager.getInstance(myProject).findFileBookmark(file);
  if (bookmarkAtFile != null) {
    final RowIcon composite = new RowIcon(2, RowIcon.Alignment.CENTER);
    composite.setIcon(icon, 0);
    composite.setIcon(bookmarkAtFile.getIcon(), 1);
    icon = composite;
  }

  if (!file.isWritable()) {
    icon = LayeredIcon.create(icon, PlatformIcons.LOCKED_ICON);
  }

  if (file.is(VFileProperty.SYMLINK)) {
    icon = LayeredIcon.create(icon, PlatformIcons.SYMLINK_ICON);
  }

  return icon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PsiDirectoryNode.java


示例6: updateImpl

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Override
protected void updateImpl(PresentationData data) {
  PsiFile value = getValue();
  data.setPresentableText(value.getName());
  data.setIcon(value.getIcon(Iconable.ICON_FLAG_READ_STATUS));

  VirtualFile file = getVirtualFile();
  if (file != null && file.is(VFileProperty.SYMLINK)) {
    String target = file.getCanonicalPath();
    if (target == null) {
      data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES);
      data.setTooltip(CommonBundle.message("vfs.broken.link"));
    }
    else {
      data.setTooltip(FileUtil.toSystemDependentName(target));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PsiFileNode.java


示例7: checkAndScheduleAttributesChange

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
private boolean checkAndScheduleAttributesChange(@NotNull VirtualFile parent,
                                                 @NotNull VirtualFile child,
                                                 @NotNull FileAttributes childAttributes) {
  boolean currentIsDirectory = child.isDirectory();
  boolean currentIsSymlink = child.is(VFileProperty.SYMLINK);
  boolean currentIsSpecial = child.is(VFileProperty.SPECIAL);
  boolean upToDateIsDirectory = childAttributes.isDirectory();
  boolean upToDateIsSymlink = childAttributes.isSymLink();
  boolean upToDateIsSpecial = childAttributes.isSpecial();

  if (currentIsDirectory != upToDateIsDirectory || currentIsSymlink != upToDateIsSymlink || currentIsSpecial != upToDateIsSpecial) {
    scheduleDeletion(child);
    scheduleReCreation(parent, child.getName(), upToDateIsDirectory);
    return true;
  }

  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:RefreshWorker.java


示例8: isFileSelectable

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
/**
 * Defines whether file can be chosen or not
 */
@RequiredDispatchThread
public boolean isFileSelectable(VirtualFile file) {
  if (file == null) return false;

  if (file.is(VFileProperty.SYMLINK) && file.getCanonicalPath() == null) {
    return false;
  }
  if (file.isDirectory() && myChooseFolders) {
    return true;
  }

  if (myFileFilter != null && !file.isDirectory()) {
    return myFileFilter.value(file);
  }

  return acceptAsJarFile(file) || acceptAsGeneralFile(file);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:FileChooserDescriptor.java


示例9: findFileByPath

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Nullable
public static NewVirtualFile findFileByPath(@Nonnull NewVirtualFileSystem vfs, @Nonnull String path) {
  Pair<NewVirtualFile, Iterable<String>> data = prepare(vfs, path);
  if (data == null) return null;

  NewVirtualFile file = data.first;
  for (String pathElement : data.second) {
    if (pathElement.isEmpty() || ".".equals(pathElement)) continue;
    if ("..".equals(pathElement)) {
      if (file.is(VFileProperty.SYMLINK)) {
        final NewVirtualFile canonicalFile = file.getCanonicalFile();
        file = canonicalFile != null ? canonicalFile.getParent() : null;
      }
      else {
        file = file.getParent();
      }
    }
    else {
      file = file.findChild(pathElement);
    }

    if (file == null) return null;
  }

  return file;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:VfsImplUtil.java


示例10: checkAndScheduleFileTypeChange

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
private boolean checkAndScheduleFileTypeChange(@Nonnull VirtualFile parent,
                                               @Nonnull VirtualFile child,
                                               @Nonnull FileAttributes childAttributes) {
  boolean currentIsDirectory = child.isDirectory();
  boolean currentIsSymlink = child.is(VFileProperty.SYMLINK);
  boolean currentIsSpecial = child.is(VFileProperty.SPECIAL);
  boolean upToDateIsDirectory = childAttributes.isDirectory();
  boolean upToDateIsSymlink = childAttributes.isSymLink();
  boolean upToDateIsSpecial = childAttributes.isSpecial();

  if (currentIsDirectory != upToDateIsDirectory || currentIsSymlink != upToDateIsSymlink || currentIsSpecial != upToDateIsSpecial) {
    scheduleDeletion(child);
    scheduleCreation(parent, child.getName(), upToDateIsDirectory, true);
    return true;
  }

  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:RefreshWorker.java


示例11: createFile

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Nullable
protected PsiFile createFile(@Nonnull Project project, @Nonnull VirtualFile file, @Nonnull FileType fileType) {
  if (fileType.isBinary() || file.is(VFileProperty.SPECIAL)) {
    return SingleRootFileViewProvider.isTooLargeForContentLoading(file) ?
           new PsiLargeBinaryFileImpl((PsiManagerImpl)getManager(), this) :
           new PsiBinaryFileImpl((PsiManagerImpl)getManager(), this);
  }
  if (!SingleRootFileViewProvider.isTooLargeForIntelligence(file)) {
    final PsiFile psiFile = createFile(getBaseLanguage());
    if (psiFile != null) return psiFile;
  }

  if (SingleRootFileViewProvider.isTooLargeForContentLoading(file)) {
    return new PsiLargeTextFileImpl(this);
  }

  return new PsiPlainTextFileImpl(this);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:AbstractFileViewProvider.java


示例12: updateIcon

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@Nonnull IconDescriptor iconDescriptor, @Nonnull PsiElement element, int flags) {
  if (element instanceof PsiFile) {
    if (iconDescriptor.getMainIcon() == null) {
      FileType fileType = ((PsiFile)element).getFileType();
      iconDescriptor.setMainIcon(fileType.getIcon());
    }

    VirtualFile virtualFile = ((PsiFile)element).getVirtualFile();
    if (virtualFile != null && virtualFile.is(VFileProperty.SYMLINK)) {
      iconDescriptor.addLayerIcon(AllIcons.Nodes.Symlink);
    }
  }
  else {
    Icon languageElementIcon = LanguageElementIcons.INSTANCE.forLanguage(element.getLanguage());
    if (languageElementIcon == null) {
      return;
    }

    iconDescriptor.addLayerIcon(languageElementIcon);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:PsiFileIconDescriptorUpdater.java


示例13: processFile

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
public boolean processFile(NewVirtualFile file) {
  if (file.isDirectory() || file.is(VFileProperty.SPECIAL)) return true;
  try {
    DataInputStream stream = FSRecords.readContent(file.getId());
    if (stream == null) return true;
    byte[] bytes = FileUtil.loadBytes(stream);
    totalSize.addAndGet(bytes.length);
    count.incrementAndGet();

    ProgressManager.getInstance().getProgressIndicator().setText(file.getPresentableUrl());
  }
  catch (IOException e1) {
    LOG.error(e1);
  }
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:LoadAllVfsStoredContentsAction.java


示例14: patchIcon

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
protected Icon patchIcon(Icon original, VirtualFile file) {
  Icon icon = original;

  final Bookmark bookmarkAtFile = BookmarkManager.getInstance(myProject).findFileBookmark(file);
  if (bookmarkAtFile != null) {
    final RowIcon composite = new RowIcon(2, RowIcon.Alignment.CENTER);
    composite.setIcon(icon, 0);
    composite.setIcon(bookmarkAtFile.getIcon(), 1);
    icon = composite;
  }

  if (!file.isWritable()) {
    icon = LayeredIcon.create(icon, AllIcons.Nodes.Locked);
  }

  if (file.is(VFileProperty.SYMLINK)) {
    icon = LayeredIcon.create(icon, AllIcons.Nodes.Symlink);
  }

  return icon;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:PsiDirectoryNode.java


示例15: updateImpl

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Override
protected void updateImpl(PresentationData data) {
  PsiFile value = getValue();
  data.setPresentableText(value.getName());
  data.setIcon(IconDescriptorUpdaters.getIcon(value, Iconable.ICON_FLAG_READ_STATUS));

  VirtualFile file = getVirtualFile();
  if (file != null && file.is(VFileProperty.SYMLINK)) {
    String target = file.getCanonicalPath();
    if (target == null) {
      data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES);
      data.setTooltip(CommonBundle.message("vfs.broken.link"));
    }
    else {
      data.setTooltip(FileUtil.toSystemDependentName(target));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:PsiFileNode.java


示例16: findMetadataFile

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
private static VirtualFile findMetadataFile(VirtualFile root) {
  if (!root.is(VFileProperty.SYMLINK)) {
    //noinspection UnsafeVfsRecursion
    for (VirtualFile child : asList(root.getChildren())) {
      if (child.getName().equals("spring-configuration-metadata.json")) {
        return child;
      }
      VirtualFile matchedFile = findMetadataFile(child);
      if (matchedFile != null) {
        return matchedFile;
      }
    }
  }
  return null;
}
 
开发者ID:1tontech,项目名称:intellij-spring-assistant,代码行数:16,代码来源:ContainerInfo.java


示例17: modifyRoots

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Override
protected void modifyRoots(@NotNull VirtualFile vFile, @NotNull ContentEntry entry) {
    VfsUtilCore.visitChildrenRecursively(vFile, new VirtualFileVisitor() {
        @Override
        public boolean visitFile(@NotNull VirtualFile file) {
            if (file.isDirectory() && file.is(VFileProperty.SYMLINK)) {
                entry.addExcludeFolder(file);
                return false;
            } else {
                return true;
            }
        }
    });
}
 
开发者ID:NeoFusion,项目名称:idea-exclude-symlinks-plugin,代码行数:15,代码来源:MarkSymlinksAsExcludedAction.java


示例18: isFileVisible

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
/**
 * Defines whether a file is visible in the tree.
 */
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
  if (file.is(VFileProperty.SYMLINK) && file.getCanonicalPath() == null) {
    return false;
  }

  if (!file.isDirectory()) {
    if (FileElement.isArchive(file)) {
      if (!myChooseJars && !myChooseJarContents) {
        return false;
      }
    }
    else if (!myChooseFiles) {
      return false;
    }
    if (myFileFilter != null && !myFileFilter.value(file)) {
      return false;
    }
  }

  if (isHideIgnored() && FileTypeManager.getInstance().isFileIgnored(file)) {
    return false;
  }

  if (!showHiddenFiles && FileElement.isFileHidden(file)) {
    return false;
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FileChooserDescriptor.java


示例19: findFileByPath

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Nullable
public static NewVirtualFile findFileByPath(@NotNull NewVirtualFileSystem vfs, @NotNull @NonNls String path) {
  Pair<NewVirtualFile, Iterable<String>> data = prepare(vfs, path);
  if (data == null) {
    return null;
  }

  NewVirtualFile file = data.first;
  for (String pathElement : data.second) {
    if (pathElement.isEmpty() || ".".equals(pathElement)) continue;
    if ("..".equals(pathElement)) {
      if (file.is(VFileProperty.SYMLINK)) {
        final NewVirtualFile canonicalFile = file.getCanonicalFile();
        file = canonicalFile != null ? canonicalFile.getParent() : null;
      }
      else {
        file = file.getParent();
      }
    }
    else {
      file = file.findChild(pathElement);
    }

    if (file == null) return null;
  }

  return file;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:VfsImplUtil.java


示例20: findFileByPathIfCached

import com.intellij.openapi.vfs.VFileProperty; //导入依赖的package包/类
@Nullable
public static NewVirtualFile findFileByPathIfCached(@NotNull NewVirtualFileSystem vfs, @NotNull @NonNls String path) {
  Pair<NewVirtualFile, Iterable<String>> data = prepare(vfs, path);
  if (data == null) {
    return null;
  }

  NewVirtualFile file = data.first;
  for (String pathElement : data.second) {
    if (pathElement.isEmpty() || ".".equals(pathElement)) continue;
    if ("..".equals(pathElement)) {
      if (file.is(VFileProperty.SYMLINK)) {
        final String canonicalPath = file.getCanonicalPath();
        final NewVirtualFile canonicalFile = canonicalPath != null ? findFileByPathIfCached(vfs, canonicalPath) : null;
        file = canonicalFile != null ? canonicalFile.getParent() : null;
      }
      else {
        file = file.getParent();
      }
    }
    else {
      file = file.findChildIfCached(pathElement);
    }

    if (file == null) return null;
  }

  return file;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:VfsImplUtil.java



注:本文中的com.intellij.openapi.vfs.VFileProperty类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MessageSummary类代码示例发布时间:2022-05-23
下一篇:
Java ASN1TaggedObjectParser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap