Package com.intellij.util

Examples of com.intellij.util.ThreeState


  public XmlAttributeDescriptor getAttributeDescriptor(final String attrName, XmlTag xmlTag) {
    final String attributeName = DirectiveUtil.normalizeAttributeName(attrName);
    if (xmlTag != null) {
      final Project project = xmlTag.getProject();
      final String tagName = xmlTag.getName();
      ThreeState attributeAvailable = isApplicable(project, attributeName, tagName, AngularDirectivesDocIndex.INDEX_ID);
      if (attributeAvailable == ThreeState.UNSURE) {
        attributeAvailable = isApplicable(project, attributeName, tagName, AngularDirectivesIndex.INDEX_ID);
      }
      return attributeAvailable == ThreeState.YES ? createDescriptor(project, attributeName) : null;
    }
View Full Code Here


      if (stack.isEmpty()) {
        if (iterator.hasNext()) stack.addFirst(iterator.next());
        else break;
      }
      BnfRule rule = stack.pollFirst();
      ThreeState color = colors.get(rule);
      if (color == ThreeState.UNSURE) {
        stack.addFirst(rule);
        colors.put(rule, ThreeState.YES);
        for (BnfRule child : ruleGraph.getSubRules(rule)) {
          if (child == rule) continue;
          ThreeState childColor = colors.get(child);
          if (childColor == null || childColor == ThreeState.NO) continue;

          if (childColor == ThreeState.YES &&
              !ContainerUtil.intersects(ruleGraph.getSubRules(child), inheritors)) {
            continue;
View Full Code Here

  private CompareResult looksEqual(ShallowNodeComparator<OT, NT> comparator, OT oldChild1, NT newChild1) {
    if (oldChild1 == null || newChild1 == null) {
      return oldChild1 == newChild1 ? CompareResult.EQUAL : CompareResult.NOT_EQUAL;
    }
    if (!comparator.typesEqual(oldChild1, newChild1)) return CompareResult.NOT_EQUAL;
    ThreeState ret = comparator.deepEqual(oldChild1, newChild1);
    if (ret == ThreeState.YES) return CompareResult.EQUAL;
    if (ret == ThreeState.UNSURE) return CompareResult.DRILL_DOWN_NEEDED;
    return CompareResult.TYPE_ONLY;
  }
View Full Code Here

    int start = 0;
    while (start < oldSize && start < newSize) {
      OT oldChild = oldChildren[start];
      NT newChild = newChildren[start];
      if (!comparator.typesEqual(oldChild, newChild)) break;
      final ThreeState dp = comparator.deepEqual(oldChild, newChild);
      if (deeps != null) deeps[start] = dp;

      if (dp != ThreeState.YES) {
        if (!comparator.hashcodesEqual(oldChild, newChild)) break;
        if (dp == ThreeState.UNSURE) {
          build(oldChild, newChild, level + 1);
          walkedDeep = true;
        }
        else if (dp == ThreeState.NO) {
          myConsumer.nodeReplaced(oldChild, newChild);
        }
      }

      start++;
    }

    int oldEnd = oldSize - 1;
    int newEnd = newSize - 1;

    if (oldSize == newSize && start == newSize) {
      disposeLevel(oldChildren, oldSize, newChildren, newSize);
      return; // No changes at all at this level
    }

    while (oldEnd >= start && newEnd >= start) {
      OT oldChild = oldChildren[oldEnd];
      NT newChild = newChildren[newEnd];
      if (!comparator.typesEqual(oldChild, newChild)) break;
      final ThreeState dp = comparator.deepEqual(oldChild, newChild);
      if (deeps != null) deeps[oldEnd] = dp;
      if (dp != ThreeState.YES) {
        if (!comparator.hashcodesEqual(oldChild, newChild)) break;
        if (dp == ThreeState.UNSURE) {
          build(oldChild, newChild, level + 1);
          walkedDeep = true;
        }
        else if (dp == ThreeState.NO) {
          myConsumer.nodeReplaced(oldChild, newChild);
        }
      }

      oldEnd--;
      newEnd--;
    }

    if (oldSize == newSize) {
      for (int i = start; i <= newEnd; i++) {
        final OT oldChild = oldChildren[i];
        final NT newChild = newChildren[i];

        if (comparator.typesEqual(oldChild, newChild)) {
          final ThreeState de = deeps[i];
          if (de == ThreeState.UNSURE) {
            build(oldChild, newChild, level + 1);
          }
          else if (de == ThreeState.NO || de == null) {
            myConsumer.nodeReplaced(oldChild, newChild);
View Full Code Here

TOP

Related Classes of com.intellij.util.ThreeState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.