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


Java ContainerUtil.or方法代码示例

本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.or方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.or方法的具体用法?Java ContainerUtil.or怎么用?Java ContainerUtil.or使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.containers.ContainerUtil的用法示例。


在下文中一共展示了ContainerUtil.or方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isFlagCheck

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static boolean isFlagCheck(PsiElement element) {
  PsiStatement statement = PsiTreeUtil.getParentOfType(element, PsiStatement.class);
  if (!(statement instanceof PsiIfStatement)) return false;

  PsiExpression condition = ((PsiIfStatement)statement).getCondition();
  if (!PsiTreeUtil.isAncestor(condition, element, false)) return false;

  if (isCompileTimeFlagReference(condition)) return true;

  Collection<PsiReferenceExpression> refs = PsiTreeUtil.findChildrenOfType(condition, PsiReferenceExpression.class);
  return ContainerUtil.or(refs, new Condition<PsiReferenceExpression>() {
    @Override
    public boolean value(PsiReferenceExpression ref) {
      return isCompileTimeFlagReference(ref);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DataFlowInspectionBase.java

示例2: isAvailable

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public boolean isAvailable(@NotNull final Project project, Editor editor, PsiFile file) {
  final PsiElement leaf = file.findElementAt(editor.getCaretModel().getOffset());
  final PsiModifierListOwner owner = getAnnotationOwner(leaf);
  if (owner != null && isSourceCode(owner)) {
    boolean hasSrcInferredAnnotation = ContainerUtil.or(findSignatureNonCodeAnnotations(owner, true), new Condition<PsiAnnotation>() {
      @Override
      public boolean value(PsiAnnotation annotation) {
        return AnnotationUtil.isInferredAnnotation(annotation);
      }
    });
    if (hasSrcInferredAnnotation) {
      setText((CodeInsightSettings.getInstance().SHOW_SOURCE_INFERRED_ANNOTATIONS ? "Hide" : "Show") + " annotations inferred from source code");
      return true;
    }
  }
  
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ToggleSourceInferredAnnotations.java

示例3: check

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void check(@NotNull final File file) {
  boolean parentAlreadyRegistered = ContainerUtil.or(myParentPaths, new Condition<File>() {
    @Override
    public boolean value(@NotNull File parentCandidate) {
      return VfsUtilCore.isAncestor(parentCandidate, file, true);
    }
  });

  if (!parentAlreadyRegistered) {
    ContainerUtil.retainAll(myParentPaths, new Condition<File>() {
      @Override
      public boolean value(@NotNull File childCandidate) {
        return !VfsUtilCore.isAncestor(file, childCandidate, true);
      }
    });

    myParentPaths.add(file);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SuperfluousRemover.java

示例4: checkListForPaths

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
static boolean checkListForPaths(@NotNull final String workingCopyRoot,
                                 @NotNull final String sourceBranch,
                                 @NotNull LogHierarchyNode node) {
  // TODO: Such filtering logic is not clear enough so far (and probably not correct for all cases - for instance when we perform merge
  // TODO: from branch1 to branch2 and have revision which contain merge changes from branch3 to branch1.
  // TODO: In this case paths of child log entries will not contain neither urls from branch1 nor from branch2 - and checkEntry() method
  // TODO: will return true => so such revision will not be used (and displayed) further.

  // TODO: Why do we check entries recursively - we have a revision - set of changes in the "merge from" branch? Why do we need to check
  // TODO: where they came from - we want avoid some circular merges or what? Does subversion itself perform such checks or not?
  boolean isLocalChange = ContainerUtil.or(node.getChildren(), new Condition<LogHierarchyNode>() {
    @Override
    public boolean value(@NotNull LogHierarchyNode child) {
      return checkForSubtree(child, workingCopyRoot, sourceBranch);
    }
  });

  return isLocalChange || checkForEntry(node.getMe(), workingCopyRoot, sourceBranch);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MergeCalculatorTask.java

示例5: containsImport

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static boolean containsImport(List<String> importedNames, final String pkg) {
  return ContainerUtil.or(importedNames, new Condition<String>() {
    @Override
    public boolean value(String s) {
      return s.startsWith(pkg + '.') || s.equals(pkg);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ExplicitlyImportedWeigher.java

示例6: is

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean is(@NotNull StatusType... types) {
  return ContainerUtil.or(types, new Condition<StatusType>() {
    @Override
    public boolean value(StatusType type) {
      return is(type);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:Status.java

示例7: isProperty

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean isProperty(@NotNull StatusType... types) {
  return ContainerUtil.or(types, new Condition<StatusType>() {
    @Override
    public boolean value(StatusType type) {
      return isProperty(type);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:Status.java

示例8: checkThatChangesAreUnderSvn

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static boolean checkThatChangesAreUnderSvn(@Nullable Change[] changes) {
  boolean result = false;

  if (changes != null) {
    result = ContainerUtil.or(changes, new Condition<Change>() {
      @Override
      public boolean value(Change change) {
        return isUnderSvn(change.getBeforeRevision()) || isUnderSvn(change.getAfterRevision());
      }
    });
  }

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

示例9: processMergeinfoProperty

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private SvnMergeInfoCache.MergeCheckResult processMergeinfoProperty(final String pathWithRevisionNumber,
                                                                    final long revisionAsked,
                                                                    @NotNull PropertyValue value,
                                                                    final String trunkRelativeUrl,
                                                                    final boolean self) throws SvnBindException {
  SvnMergeInfoCache.MergeCheckResult result;
  Map<String, SVNMergeRangeList> mergedPathsMap = parseMergeInfo(value);
  String mergedPathAffectingTrunkUrl = ContainerUtil.find(mergedPathsMap.keySet(), new Condition<String>() {
    @Override
    public boolean value(String path) {
      return trunkRelativeUrl.startsWith(path);
    }
  });

  if (mergedPathAffectingTrunkUrl != null) {
    SVNMergeRangeList mergeRangeList = mergedPathsMap.get(mergedPathAffectingTrunkUrl);

    fillMergedRevisions(pathWithRevisionNumber, mergeRangeList);

    boolean isAskedRevisionMerged = ContainerUtil.or(mergeRangeList.getRanges(), new Condition<SVNMergeRange>() {
      @Override
      public boolean value(@NotNull SVNMergeRange range) {
        return isInRange(range, revisionAsked) && (range.isInheritable() || self);
      }
    });

    result = SvnMergeInfoCache.MergeCheckResult.getInstance(isAskedRevisionMerged);
  }
  else {
    myPathMergedMap.put(pathWithRevisionNumber, Collections.<Long>emptySet());
    result = SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
  }

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

示例10: process

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean process(@NotNull String workingCopyRelativePath, @NotNull Map<String, SVNMergeRangeList> mergedPathsMap) {
  boolean processed = false;
  final boolean isCurrentPath = workingCopyRelativePath.equals(mySourceRelativePath);

  if (mergedPathsMap.isEmpty()) {
    myIsMerged = false;
    processed = true;
  }
  else {
    String mergedPathAffectingSourcePath = ContainerUtil.find(mergedPathsMap.keySet(), new Condition<String>() {
      @Override
      public boolean value(String path) {
        return SVNPathUtil.isAncestor(myRepositoryRelativeSourcePath, SvnUtil.ensureStartSlash(path));
      }
    });

    if (mergedPathAffectingSourcePath != null) {
      SVNMergeRangeList mergeRangeList = mergedPathsMap.get(mergedPathAffectingSourcePath);

      processed = true;
      myIsMerged = ContainerUtil.or(mergeRangeList.getRanges(), new Condition<SVNMergeRange>() {
        @Override
        public boolean value(@NotNull SVNMergeRange range) {
          return BranchInfo.isInRange(range, myRevisionNumber) && (range.isInheritable() || isCurrentPath);
        }
      });
    }
  }

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

示例11: hasSwitchedRoots

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private boolean hasSwitchedRoots() {
  final File currentRoot = myMergeContext.getWcInfo().getRootInfo().getIoFile();

  return ContainerUtil.or(myMergeContext.getVcs().getAllWcInfos(), new Condition<WCInfo>() {
    @Override
    public boolean value(WCInfo info) {
      return NestedCopyType.switched.equals(info.getType()) && FileUtil.isAncestor(currentRoot, info.getRootInfo().getIoFile(), true);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MergeInitChecksTask.java

示例12: hasMoreImportantReference

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static boolean hasMoreImportantReference(@NotNull PsiReference[] references, @NotNull PropertyReference propertyReference) {
  return propertyReference.isSoft() && ContainerUtil.or(references, new Condition<PsiReference>() {
    @Override
    public boolean value(PsiReference reference) {
      return !reference.isSoft();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PropertiesCompletionContributor.java

示例13: getImplementsListTypes

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static PsiClassType[] getImplementsListTypes(GrTypeDefinition grType) {
  final Collection<PsiClassType> result = ContainerUtil.newLinkedHashSet();
  final PsiClassType[] implementsTypes = getReferenceListTypes(grType.getImplementsClause());
  final PsiClassType[] extendsTypes = getReferenceListTypes(grType.getExtendsClause());
  result.addAll(Arrays.asList(implementsTypes));
  result.addAll(AstTransformContributor.runContributorsForImplementsTypes(grType));
  if (!grType.isInterface() && !ContainerUtil.or(implementsTypes, IS_GROOVY_OBJECT) && !ContainerUtil.or(extendsTypes, IS_GROOVY_OBJECT)) {
    result.add(getGroovyObjectType(grType));
  }
  return result.toArray(new PsiClassType[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GrClassImplUtil.java

示例14: finishLookup

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void finishLookup(char completionChar, @Nullable final LookupElement item) {
  //noinspection deprecation,unchecked
  if (item == null ||
      item instanceof EmptyLookupItem ||
      item.getObject() instanceof DeferredUserLookupValue &&
      item.as(LookupItem.CLASS_CONDITION_KEY) != null &&
      !((DeferredUserLookupValue)item.getObject()).handleUserSelection(item.as(LookupItem.CLASS_CONDITION_KEY), myProject)) {
    doHide(false, true);
    fireItemSelected(null, completionChar);
    return;
  }

  if (myDisposed) { // DeferredUserLookupValue could close us in any way
    return;
  }

  final PsiFile file = getPsiFile();
  boolean writableOk = file == null || FileModificationService.getInstance().prepareFileForWrite(file);
  if (myDisposed) { // ensureFilesWritable could close us by showing a dialog
    return;
  }

  if (!writableOk) {
    doHide(false, true);
    fireItemSelected(null, completionChar);
    return;
  }

  final String prefix = itemPattern(item);
  boolean plainMatch = ContainerUtil.or(item.getAllLookupStrings(), new Condition<String>() {
    @Override
    public boolean value(String s) {
      return StringUtil.containsIgnoreCase(s, prefix);
    }
  });
  if (!plainMatch) {
    FeatureUsageTracker.getInstance().triggerFeatureUsed(CodeCompletionFeatures.EDITING_COMPLETION_CAMEL_HUMPS);
  }

  myFinishing = true;
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    public void run() {
      myEditor.getDocument().startGuardedBlockChecking();
      try {
        insertLookupString(item, getPrefixLength(item));
      }
      finally {
        myEditor.getDocument().stopGuardedBlockChecking();
      }
    }
  });

  if (myDisposed) { // any document listeners could close us
    return;
  }

  doHide(false, true);

  fireItemSelected(item, completionChar);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:61,代码来源:LookupImpl.java

示例15: hasGroovyCompatibleModules

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static boolean hasGroovyCompatibleModules(Project project, final Condition<Module> condition) {
  return ContainerUtil.or(ModuleManager.getInstance(project).getModules(), isGroovyCompatibleModule(condition));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ModuleChooserUtil.java


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