當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。