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


Java ThreeState.YES属性代码示例

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


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

示例1: customizeCellRenderer

@Override
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
  if (!(value instanceof LaunchCompatibility)) {
    return;
  }

  LaunchCompatibility compatibility = (LaunchCompatibility)value;
  ThreeState compatible = compatibility.isCompatible();
  if (compatible == ThreeState.YES) {
    append("Yes");
  } else {
    if (compatible == ThreeState.NO) {
      append("No", SimpleTextAttributes.ERROR_ATTRIBUTES);
    } else {
      append("Maybe");
    }
    String reason = compatibility.getReason();
    if (reason != null) {
      append(", ");
      append(reason);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DeviceChooser.java

示例2: isAuthenticatedFor

/**
 * Bases on presence of notifications!
 */
public ThreeState isAuthenticatedFor(@NotNull VirtualFile vf, @Nullable ClientFactory factory) {
  final WorkingCopy wcCopy = myRootsToWorkingCopies.getWcRoot(vf);
  if (wcCopy == null) return ThreeState.UNSURE;

  // check there's no cancellation yet
  final boolean haveCancellation = getStateFor(wcCopy.getUrl());
  if (haveCancellation) return ThreeState.NO;

  final Boolean keptResult = myCopiesPassiveResults.get(wcCopy.getUrl());
  if (Boolean.TRUE.equals(keptResult)) return ThreeState.YES;
  if (Boolean.FALSE.equals(keptResult)) return ThreeState.NO;

  // check have credentials
  final boolean calculatedResult =
    factory == null ? passiveValidation(myVcs.getProject(), wcCopy.getUrl()) : passiveValidation(factory, wcCopy.getUrl());
  myCopiesPassiveResults.put(wcCopy.getUrl(), calculatedResult);
  return calculatedResult ? ThreeState.YES : ThreeState.NO;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SvnAuthenticationNotifier.java

示例3: silentLogin

@Override
public ThreeState silentLogin(boolean forceCheck) throws AuthenticationException {
  if (mySettings.isOffline())  return ThreeState.NO;

  try {
    silentLoginImpl(forceCheck);
  }
  catch (AuthenticationException e) {
    if (e.isSolveable()) {
      clearOldCredentials();
      return ThreeState.UNSURE;
    }
    throw e;
  }
  return ThreeState.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:CvsLoginWorkerImpl.java

示例4: SmartSerializer

public SmartSerializer(boolean trackSerializedNames, boolean useSkipEmptySerializationFilter) {
  mySerializedAccessorNameTracker = trackSerializedNames ? new LinkedHashSet<String>() : null;

  mySerializationFilter = useSkipEmptySerializationFilter ?
                          new SkipEmptySerializationFilter() {
                            @Override
                            protected ThreeState accepts(@NotNull String name, @NotNull Object beanValue) {
                              return mySerializedAccessorNameTracker != null && mySerializedAccessorNameTracker.contains(name) ? ThreeState.YES : ThreeState.UNSURE;
                            }
                          } :
                          new SkipDefaultValuesSerializationFilters() {
                            @Override
                            public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) {
                              if (mySerializedAccessorNameTracker != null && mySerializedAccessorNameTracker.contains(accessor.getName())) {
                                return true;
                              }
                              return super.accepts(accessor, bean);
                            }
                          };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SmartSerializer.java

示例5: shouldSkipAutopopup

@NotNull
@Override
public ThreeState shouldSkipAutopopup(@NotNull PsiElement contextElement, @NotNull PsiFile psiFile, int offset) {
  ASTNode node = contextElement.getNode();
  if (node != null && node.getElementType() == XmlTokenType.XML_DATA_CHARACTERS) {
    PsiElement parent = contextElement.getParent();
    if (parent instanceof XmlText || parent instanceof XmlDocument) {
      String contextElementText = contextElement.getText();
      int endOffset = offset - contextElement.getTextRange().getStartOffset();
      String prefix = contextElementText.substring(0, Math.min(contextElementText.length(), endOffset));
      if (!StringUtil.startsWithChar(prefix, '<') && !StringUtil.startsWithChar(prefix, '&')) {
        return ThreeState.YES;
      }
    }
  }
  return ThreeState.UNSURE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:HtmlTextCompletionConfidence.java

示例6: apply

@Override
public void apply() throws ConfigurationException {
  validateState();
  if (myErrorsPanel.hasCriticalErrors()) {
    return;
  }

  boolean dataChanged = false;
  for (Configurable configurable: myConfigurables) {
    if (configurable.isModified()) {
      dataChanged = true;
      configurable.apply();
    }
  }

  if (!myProject.isDefault() && (dataChanged || GradleSyncState.getInstance(myProject).isSyncNeeded() == ThreeState.YES)) {
    GradleProjectImporter.getInstance().requestProjectSync(myProject, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AndroidProjectStructureConfigurable.java

示例7: computeInlineDebuggerData

@NotNull
@Override
public ThreeState computeInlineDebuggerData(@NotNull final XInlineDebuggerDataCallback callback) {
  computeSourcePosition(new XNavigatable() {
    @Override
    public void setSourcePosition(@Nullable XSourcePosition sourcePosition) {
      callback.computed(sourcePosition);
    }
  }, true);
  return ThreeState.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaValue.java

示例8: resolveClass

@Nullable
@Override
public ExternalClassResolveResult resolveClass(@NotNull String shortClassName, @NotNull ThreeState isAnnotation, @NotNull Module contextModule) {
  if (JCiPUtil.isJCiPAnnotation(shortClassName) && isAnnotation == ThreeState.YES) {
    return new ExternalClassResolveResult("net.jcip.annotations." + shortClassName, JDCIP_LIBRARY_DESCRIPTOR);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JCiPExternalLibraryResolver.java

示例9: isReferenceToAnnotation

private static ThreeState isReferenceToAnnotation(final PsiElement psiElement) {
  if (!PsiUtil.isLanguageLevel5OrHigher(psiElement)) {
    return ThreeState.NO;
  }
  if (PsiTreeUtil.getParentOfType(psiElement, PsiAnnotation.class) != null) {
    return ThreeState.YES;
  }
  if (PsiTreeUtil.getParentOfType(psiElement, PsiImportStatement.class) != null) {
    return ThreeState.UNSURE;
  }
  return ThreeState.NO;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:OrderEntryFix.java

示例10: getProductName

protected String getProductName(ThreeState full) {
  ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
  if (full == ThreeState.YES) {
    return namesInfo.getFullProductName();
  }
  else if (full == ThreeState.NO) {
    return namesInfo.getProductName();
  }
  else {
    return namesInfo.getProductName().equals("IDEA") ? namesInfo.getFullProductName() : namesInfo.getProductName();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ConfigImportSettings.java

示例11: shouldSkipAutopopup

@NotNull
@Override
public ThreeState shouldSkipAutopopup(@NotNull PsiElement contextElement, @NotNull PsiFile psiFile, int offset) {
  if (PsiTreeUtil.findElementOfClassAtOffset(psiFile, offset, PsiComment.class, false) != null) {
    return ThreeState.YES;
  }

  return ThreeState.UNSURE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SkipAutopopupInComments.java

示例12: shouldFocusLookup

@NotNull
@Override
public ThreeState shouldFocusLookup(@NotNull CompletionParameters parameters) {
  final ASTNode node = parameters.getPosition().getNode();
  if (node == null) return ThreeState.UNSURE;

  final IElementType elementType = node.getElementType();
  if (elementType == XmlTokenType.XML_NAME || elementType == XmlTokenType.XML_TAG_NAME) {
    return ThreeState.YES;
  }
  return ThreeState.UNSURE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XmlNameCompletionConfidence.java

示例13: equal

boolean equal(@Nullable Binding binding, @Nullable Object currentValue, @Nullable Object defaultValue) {
  if (defaultValue instanceof Element && currentValue instanceof Element) {
    return JDOMUtil.areElementsEqual((Element)currentValue, (Element)defaultValue);
  }
  else {
    if (currentValue == defaultValue) {
      return true;
    }
    if (currentValue == null || defaultValue == null) {
      return false;
    }

    if (binding instanceof BasePrimitiveBinding) {
      Binding referencedBinding = ((BasePrimitiveBinding)binding).myBinding;
      if (referencedBinding instanceof BeanBinding) {
        BeanBinding classBinding = (BeanBinding)referencedBinding;
        ThreeState compareByFields = classBinding.compareByFields;
        if (compareByFields == ThreeState.UNSURE) {
          compareByFields = ReflectionUtil.getDeclaredMethod(classBinding.myBeanClass, "equals", Object.class) == null ? ThreeState.YES : ThreeState.NO;

          classBinding.compareByFields = compareByFields;
        }

        if (compareByFields == ThreeState.YES) {
          return classBinding.equalByFields(currentValue, defaultValue, this);
        }
      }
    }

    return Comparing.equal(currentValue, defaultValue);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SkipDefaultsSerializationFilter.java

示例14: shouldFocusLookup

@NotNull
@Override
public ThreeState shouldFocusLookup(@NotNull CompletionParameters parameters) {
  final PsiElement position = parameters.getPosition();

  PsiFile file = position.getContainingFile();
  if (file instanceof GroovyFile && GroovyScriptUtil.getScriptType((GroovyFile)file) != GroovyScriptUtil.DEFAULT_TYPE) {
    return ThreeState.NO;
  }

  if (position.getParent() instanceof GrReferenceElement &&
      PsiJavaPatterns.psiElement().afterLeaf(PsiJavaPatterns.psiElement().withText("(").withParent(GrForStatement.class)).accepts(position)) {
    return ThreeState.NO;
  }

  if (position.getParent() instanceof GrReferenceExpression) {
    final GrReferenceExpression ref = (GrReferenceExpression)position.getParent();
    final GrExpression qualifier = ref.getQualifierExpression();
    if (qualifier == null) {
      if (isPossibleClosureParameter(ref)) return ThreeState.NO;
      if (parameters.getOriginalFile().getUserData(GROOVY_SHELL_FILE) == Boolean.TRUE) {
        return ThreeState.NO;
      }

      GrExpression runtimeQualifier = PsiImplUtil.getRuntimeQualifier(ref);
      if (runtimeQualifier != null && runtimeQualifier.getType() == null) {
        return ThreeState.NO;
      }

      return ThreeState.YES;
    }

    if (qualifier.getType() == null) {
      return ThreeState.NO;
    }
    return ThreeState.YES;
  }
  return ThreeState.UNSURE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:GroovyCompletionConfidence.java

示例15: isSyncNeeded

/**
 * Indicates whether a project sync with Gradle is needed. A Gradle sync is usually needed when a build.gradle or settings.gradle file has
 * been updated <b>after</b> the last project sync was performed.
 *
 * @return {@code YES} if a sync with Gradle is needed, {@code FALSE} otherwise, or {@code UNSURE} If the timestamp of the last Gradle
 * sync cannot be found.
 */
@NotNull
public ThreeState isSyncNeeded() {
  long lastSync = getLastGradleSyncTimestamp();
  if (lastSync < 0) {
    // Previous sync may have failed. We don't know if a sync is needed or not. Let client code decide.
    return ThreeState.UNSURE;
  }
  return isSyncNeeded(lastSync) ? ThreeState.YES : ThreeState.NO;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GradleSyncState.java


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