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


Java PackageSetBase类代码示例

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


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

示例1: rebuildFiles

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
private void rebuildFiles(boolean groupByPackages,
                          @Nullable Pair<PackageSetBase, NamedScopesHolder> filter,
                          boolean showOnlyFilteredItems) {
  for (int i = getChildCount() - 1; i >= 0; i--) {
    final TreeNode node = getChildAt(i);
    if (node instanceof Disposable) {
      Disposer.dispose((Disposable)node);
    }
  }
  removeAllChildren();

  if (groupByPackages) {
    buildPackages();
    acceptFilter(filter, showOnlyFilteredItems);
  }
  else {
    buildFiles(filter, showOnlyFilteredItems);
  }

  setTreeModel(myTreeModel);

  if (myTreeModel != null) {
    myTreeModel.nodeStructureChanged(this);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:GroupTreeNode.java

示例2: acceptFilter

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Override
protected boolean acceptFilter(Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  try {
    VirtualFilePointer filePointer = getFilePointer();
    if (!filePointer.isValid()) {
      return false;
    }
    VirtualFile file = filePointer.getFile();
    if (file != null && file.isValid() && filter.first.contains(file, getProject(), filter.second)) {
      applyFilter(true);
      return true;
    }
  }
  catch (Throwable e) {
    // TODO: catch and ignore exceptions: see to FilePatternPackageSet
    // sometimes for new file DirectoryFileIndex.getContentRootForFile() return random path
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FileTreeNode.java

示例3: acceptFilter

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
protected boolean acceptFilter(@Nullable Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  boolean apply = false;
  if (children != null && filter != null) {
    for (Iterator it = children.iterator(); it.hasNext(); ) {
      AbstractTreeNode node = (AbstractTreeNode)it.next();
      if (node.acceptFilter(filter, showOnlyFilteredItems)) {
        apply = true;
      }
      else if (showOnlyFilteredItems) {
        if (node instanceof Disposable) {
          Disposer.dispose((Disposable)node);
        }
        it.remove();
      }
    }
    applyFilter(apply);
  }
  return apply;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AbstractTreeNode.java

示例4: getScopeFilter

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Nullable
private Pair<PackageSetBase, NamedScopesHolder> getScopeFilter() {
  String scopeName = VcsConfiguration.getInstance(myProject).UPDATE_FILTER_SCOPE_NAME;
  if (scopeName != null) {
    for (NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
      NamedScope scope = holder.getScope(scopeName);
      if (scope != null) {
        PackageSet packageSet = scope.getValue();
        if (packageSet instanceof PackageSetBase) {
          return Pair.create((PackageSetBase)packageSet, holder);
        }
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:UpdateInfoTree.java

示例5: getScopeFilter

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Nullable
private Pair<PackageSetBase, NamedScopesHolder> getScopeFilter() {
  String scopeName = VcsConfiguration.getInstance(myProject).UPDATE_FILTER_SCOPE_NAME;
  if (scopeName != null) {
    for (NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
      NamedScope scope = holder.getScope(scopeName);
      if (scope != null) {
        PackageSet packageSet = scope.getValue();
        if (packageSet instanceof PackageSetBase) {
          return new Pair<PackageSetBase, NamedScopesHolder>((PackageSetBase)packageSet, holder);
        }
      }
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:UpdateInfoTree.java

示例6: acceptFilter

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Override
protected boolean acceptFilter(Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  try {
    VirtualFilePointer filePointer = getFilePointer();
    if (!filePointer.isValid()) {
      return false;
    }
    VirtualFile file = filePointer.getFile();
    if (file != null && file.isValid() && filter.first.contains(file, filter.second)) {
      applyFilter(true);
      return true;
    }
  }
  catch (Throwable e) {
    // TODO: catch and ignore exceptions: see to FilePatternPackageSet
    // sometimes for new file DirectoryFileIndex.getContentRootForFile() return random path
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:FileTreeNode.java

示例7: getScopeFilter

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Nullable
private Pair<PackageSetBase, NamedScopesHolder> getScopeFilter() {
  String scopeName = getFilterScopeName();
  if (scopeName != null) {
    for (NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
      NamedScope scope = holder.getScope(scopeName);
      if (scope != null) {
        PackageSet packageSet = scope.getValue();
        if (packageSet instanceof PackageSetBase) {
          return Pair.create((PackageSetBase)packageSet, holder);
        }
      }
    }
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:UpdateInfoTree.java

示例8: rebuild

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
public void rebuild(boolean groupByPackages, @Nullable Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  myFilterAttributes = null;
  if (containsGroups()) {
    rebuildGroups(groupByPackages, filter, showOnlyFilteredItems);
  }
  else {
    rebuildFiles(groupByPackages, filter, showOnlyFilteredItems);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroupTreeNode.java

示例9: rebuildGroups

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
private void rebuildGroups(boolean groupByPackages,
                           @Nullable Pair<PackageSetBase, NamedScopesHolder> filter,
                           boolean showOnlyFilteredItems) {
  boolean apply = false;
  for (int i = 0; i < getChildCount(); i++) {
    GroupTreeNode childGroup = (GroupTreeNode)getChildAt(i);
    childGroup.rebuild(groupByPackages, filter, showOnlyFilteredItems);
    apply |= childGroup.myFilterAttributes != null;
  }
  applyFilter(apply);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GroupTreeNode.java

示例10: buildFiles

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
private void buildFiles(@Nullable Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  Collections.sort(myFilePaths, new Comparator<String>() {
    @Override
    public int compare(String path1, String path2) {
      return path1.compareToIgnoreCase(path2);
    }
  });

  boolean apply = false;

  for (final String filePath : myFilePaths) {
    final FileTreeNode child = new FileTreeNode(filePath, myInvalidAttributes, myProject, null);
    if (filter != null) {
      if (child.acceptFilter(filter, showOnlyFilteredItems)) {
        apply = true;
      }
      else if (showOnlyFilteredItems) {
        Disposer.dispose(child);
        continue;
      }
    }
    final String error = myErrorsMap.get(filePath);
    if (error != null) {
      child.setErrorText(error);
    }
    add(child);
    Disposer.register(this, child);
  }

  applyFilter(apply);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:GroupTreeNode.java

示例11: findConfiguration

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Nullable
private FileColorConfiguration findConfiguration(@NotNull final VirtualFile colored) {
  for (FileColorConfiguration configuration : ContainerUtil.concat(myApplicationLevelConfigurations, myProjectLevelConfigurations)) {
    NamedScope scope = NamedScopesHolder.getScope(myProject, configuration.getScopeName());
    if (scope != null) {
      NamedScopesHolder namedScopesHolder = NamedScopesHolder.getHolder(myProject, configuration.getScopeName(), null);
      PackageSet packageSet = scope.getValue();
      if (packageSet instanceof PackageSetBase && namedScopesHolder != null && ((PackageSetBase)packageSet).contains(colored, myProject, namedScopesHolder)) {
        return configuration;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:FileColorsModel.java

示例12: buildFiles

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
private void buildFiles(@Nullable Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  Collections.sort(myFilePaths, new Comparator<String>() {
    @Override
    public int compare(String path1, String path2) {
      return path1.compareToIgnoreCase(path2);
    }
  });

  boolean apply = false;

  for (final String filePath : myFilePaths) {
    final FileTreeNode child = new FileTreeNode(filePath, myInvalidAttributes, myProject, null);
    if (filter != null) {
      if (child.acceptFilter(filter, showOnlyFilteredItems)) {
        apply = true;
      }
      else if (showOnlyFilteredItems) {
        continue;
      }
    }
    final String error = myErrorsMap.get(filePath);
    if (error != null) {
      child.setErrorText(error);
    }
    add(child);
    Disposer.register(this, child);
  }

  applyFilter(apply);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:GroupTreeNode.java

示例13: getFilteredFilesCount

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
int getFilteredFilesCount() {
  Pair<PackageSetBase, NamedScopesHolder> scopeFilter = getScopeFilter();
  int[] result = new int[1];
  TreeUtil.traverse(myRoot, node -> {
    if (node instanceof FileTreeNode) {
      if (((FileTreeNode)node).acceptFilter(scopeFilter, true)) {
        result[0]++;
      }
    }
    return true;
  });
  return result[0];
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:UpdateInfoTree.java

示例14: getFilterScope

import com.intellij.psi.search.scope.packageSet.PackageSetBase; //导入依赖的package包/类
@Nullable
NamedScope getFilterScope() {
  Pair<PackageSetBase, NamedScopesHolder> filter = getScopeFilter();
  return filter == null ? null : filter.second.getScope(getFilterScopeName());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:UpdateInfoTree.java


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