本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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];
}
示例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());
}