当前位置: 首页>>代码示例>>Java>>正文


Java DirectoryInfo类代码示例

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


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

示例1: shouldBeShown

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
private boolean shouldBeShown(VirtualFile dir, ViewSettings settings) {
  DirectoryInfo directoryInfo = myIndex.getInfoForFile(dir);
  if (directoryInfo.isInProject()) return true;

  if (!Registry.is("ide.hide.excluded.files") && settings instanceof ProjectViewSettings && ((ProjectViewSettings)settings).isShowExcludedFiles()) {
    return directoryInfo.isExcluded();
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ProjectViewDirectoryHelper.java

示例2: getSourceRootDirectory

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Nullable
private static PsiDirectory getSourceRootDirectory(PsiDirectory directory) {
  PsiManager manager = directory.getManager();
  DirectoryIndex directoryIndex = DirectoryIndex.getInstance(manager.getProject());
  DirectoryInfo info = directoryIndex.getInfoForDirectory(directory.getVirtualFile());
  if (info == null || !info.hasSourceRoot()) return null;
  return manager.findDirectory(info.getSourceRoot());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:CreateClassUtil.java

示例3: contains

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public boolean contains(VirtualFile file) {
  VirtualFile dir = file.isDirectory() ? file : file.getParent();
  if (dir == null) return false;

  DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(dir);
  return info != null && info.hasLibraryClassRoot();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:PackageUtil.java

示例4: actionPerformed

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final Project project = e.getData(PlatformDataKeys.PROJECT);
  final DirectoryIndex index = DirectoryIndex.getInstance(project);
  if (project != null) {
    final VirtualFile root = e.getData(PlatformDataKeys.VIRTUAL_FILE);
    ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
      @Override
      public void run() {
        final ContentIterator contentIterator = new ContentIterator() {
          @Override
          public boolean processFile(VirtualFile fileOrDir) {
            LOG.info(fileOrDir.getPath());

            final DirectoryInfo directoryInfo = index.getInfoForDirectory(fileOrDir);
            if (directoryInfo != null) {
              LOG.info(directoryInfo.toString());
            }
            return true;
          }
        };
        if (root != null) {
          ProjectRootManager.getInstance(project).getFileIndex().iterateContentUnderDirectory(root, contentIterator);
        } else {
          ProjectRootManager.getInstance(project).getFileIndex().iterateContent(contentIterator);
        }
      }
    }, "Dumping directory index", true, project);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:DumpDirectoryInfoAction.java

示例5: getContentFolderType

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
@Nullable
public ContentFolderTypeProvider getContentFolderType(@Nonnull DirectoryInfo info) {
  if (info.isInModuleSource()) {
    RootIndex rootIndex = getRootIndex();
    return rootIndex.getContentFolderType(info);
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:CompilerServerDirectoryIndex.java

示例6: actionPerformed

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final Project project = e.getData(CommonDataKeys.PROJECT);
  final DirectoryIndex index = DirectoryIndex.getInstance(project);
  if (project != null) {
    final VirtualFile root = e.getData(PlatformDataKeys.VIRTUAL_FILE);
    ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
      @Override
      public void run() {
        final ContentIterator contentIterator = new ContentIterator() {
          @Override
          public boolean processFile(VirtualFile fileOrDir) {
            LOG.info(fileOrDir.getPath());

            final DirectoryInfo directoryInfo = index.getInfoForDirectory(fileOrDir);
            if (directoryInfo != null) {
              LOG.info(directoryInfo.toString());
            }
            return true;
          }
        };
        if (root != null) {
          ProjectRootManager.getInstance(project).getFileIndex().iterateContentUnderDirectory(root, contentIterator);
        } else {
          ProjectRootManager.getInstance(project).getFileIndex().iterateContent(contentIterator);
        }
      }
    }, "Dumping directory index", true, project);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:DumpDirectoryInfoAction.java

示例7: contains

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public boolean contains(@Nonnull VirtualFile file) {
  VirtualFile dir = file.isDirectory() ? file : file.getParent();
  if (dir == null) return false;

  DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(dir);
  return info != null && info.hasLibraryClassRoot();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:PackageNodeUtil.java

示例8: getInfoForDirectory

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public DirectoryInfo getInfoForDirectory(@Nonnull VirtualFile dir) {
  DirectoryInfo info = getInfoForFile(dir);
  return info.isInProject() ? info : null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:CompilerServerDirectoryIndex.java

示例9: getInfoForFile

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Nonnull
@Override
public DirectoryInfo getInfoForFile(@Nonnull VirtualFile file) {
  return getRootIndex().getInfoForFile(file);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:CompilerServerDirectoryIndex.java

示例10: getOrderEntries

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Nonnull
@Override
public OrderEntry[] getOrderEntries(@Nonnull DirectoryInfo info) {
  return getRootIndex().getOrderEntries(info);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:CompilerServerDirectoryIndex.java

示例11: shouldBeShown

import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
private static boolean shouldBeShown(DirectoryIndex directoryIndex, VirtualFile dir, ViewSettings settings) {
  DirectoryInfo directoryInfo = directoryIndex.getInfoForFile(dir);
  if (directoryInfo.isInProject()) return true;

  return settings.getViewOption(ShowExcludedFilesProjectViewPaneOptionProvider.KEY) == Boolean.TRUE && directoryInfo.isExcluded();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:BaseProjectViewDirectoryHelper.java


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