當前位置: 首頁>>代碼示例>>Java>>正文


Java Comparing.strEqual方法代碼示例

本文整理匯總了Java中com.intellij.openapi.util.Comparing.strEqual方法的典型用法代碼示例。如果您正苦於以下問題:Java Comparing.strEqual方法的具體用法?Java Comparing.strEqual怎麽用?Java Comparing.strEqual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.util.Comparing的用法示例。


在下文中一共展示了Comparing.strEqual方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: excludeProblem

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
private static void excludeProblem(final String externalName, final Map<String, Set<OfflineProblemDescriptor>> content) {
  for (Iterator<String> iter = content.keySet().iterator(); iter.hasNext();) {
    final String packageName = iter.next();
    final Set<OfflineProblemDescriptor> excluded = new HashSet<OfflineProblemDescriptor>(content.get(packageName));
    for (Iterator<OfflineProblemDescriptor> it = excluded.iterator(); it.hasNext();) {
      final OfflineProblemDescriptor ex = it.next();
      if (Comparing.strEqual(ex.getFQName(), externalName)) {
        it.remove();
      }
    }
    if (excluded.isEmpty()) {
      iter.remove();
    } else {
      content.put(packageName, excluded);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:OfflineInspectionRVContentProvider.java

示例2: update

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  final CheckedTreeNode[] selectedSuites = mySuitesTree.getSelectedNodes(CheckedTreeNode.class, null);
  final Presentation presentation = e.getPresentation();
  presentation.setEnabled(false);
  for (CheckedTreeNode node : selectedSuites) {
    final Object userObject = node.getUserObject();
    if (userObject instanceof CoverageSuite) {
      final CoverageSuite selectedSuite = (CoverageSuite)userObject;
      if (selectedSuite.getCoverageDataFileProvider() instanceof DefaultCoverageFileProvider &&
          Comparing.strEqual(((DefaultCoverageFileProvider)selectedSuite.getCoverageDataFileProvider()).getSourceProvider(),
                             DefaultCoverageFileProvider.class.getName())) {
        presentation.setEnabled(true);
      }
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:CoverageSuiteChooserDialog.java

示例3: isModified

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean isModified() {
  final List<String> order = getScopesState().myOrder;
  if (myRoot.getChildCount() != order.size()) return true;
  for (int i = 0; i < myRoot.getChildCount(); i++) {
    final MyNode node = (MyNode)myRoot.getChildAt(i);
    final ScopeConfigurable scopeConfigurable = (ScopeConfigurable)node.getConfigurable();
    final NamedScope namedScope = scopeConfigurable.getEditableObject();
    if (order.size() <= i) return true;
    final String name = order.get(i);
    if (!Comparing.strEqual(name, namedScope.getName())) return true;
    if (isInitialized(scopeConfigurable)) {
      final NamedScopesHolder holder = scopeConfigurable.getHolder();
      final NamedScope scope = holder.getScope(name);
      if (scope == null) return true;
      if (scopeConfigurable.isModified()) return true;
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:ScopeChooserConfigurable.java

示例4: isModified

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean isModified(@NotNull HttpConfigurable settings) {
  if (!isValid()) {
    return false;
  }

  return !Comparing.strEqual(myProxyExceptions.getText().trim(), settings.PROXY_EXCEPTIONS) ||
         settings.USE_PROXY_PAC != myAutoDetectProxyRb.isSelected() ||
         settings.USE_PAC_URL != myPacUrlCheckBox.isSelected() ||
         !Comparing.strEqual(settings.PAC_URL, myPacUrlTextField.getText()) ||
         settings.USE_HTTP_PROXY != myUseHTTPProxyRb.isSelected() ||
         settings.PROXY_AUTHENTICATION != myProxyAuthCheckBox.isSelected() ||
         settings.KEEP_PROXY_PASSWORD != myRememberProxyPasswordCheckBox.isSelected() ||
         settings.PROXY_TYPE_IS_SOCKS != mySocks.isSelected() ||
         !Comparing.strEqual(settings.PROXY_LOGIN, myProxyLoginTextField.getText()) ||
         !Comparing.strEqual(settings.getPlainProxyPassword(), new String(myProxyPasswordTextField.getPassword())) ||
         settings.PROXY_PORT != myProxyPortTextField.getNumber() ||
         !Comparing.strEqual(settings.PROXY_HOST, myProxyHostTextField.getText());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:HttpProxySettingsUi.java

示例5: isModified

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
@SuppressWarnings({"SimplifiableIfStatement"})
public boolean isModified() {
  LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(myProject);
  if (!extension.getLanguageLevel().equals(myLanguageLevelCombo.getSelectedLevel()) ||
       extension.isDefault() != myLanguageLevelCombo.isDefault()) {
    return true;
  }
  final String compilerOutput = getOriginalCompilerOutputUrl();
  if (!Comparing.strEqual(FileUtil.toSystemIndependentName(VfsUtilCore.urlToPath(compilerOutput)),
                          FileUtil.toSystemIndependentName(myProjectCompilerOutput.getText()))) return true;
  if (myProjectJdkConfigurable.isModified()) return true;
  if (myProjectName != null) {
    if (!myProjectName.getText().trim().equals(myProject.getName())) return true;
  }

  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:ProjectConfigurable.java

示例6: getCoverageRunner

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Nullable
private static CoverageRunner getCoverageRunner(VirtualFile file) {
  for (CoverageRunner runner : Extensions.getExtensions(CoverageRunner.EP_NAME)) {
    if (Comparing.strEqual(file.getExtension(), runner.getDataFileExtension())) return runner;
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:CoverageSuiteChooserDialog.java

示例7: getClasses

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
@NotNull
public PsiClass[] getClasses(@Nullable String shortName, @NotNull PsiPackage psiPackage, @NotNull final GlobalSearchScope scope) {
  List<PsiClass> list = null;
  String packageName = psiPackage.getQualifiedName();
  for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
    PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(dir);
    if (classes.length == 0) continue;
    if (list == null) list = new ArrayList<PsiClass>();
    for (PsiClass aClass : classes) {
      // class file can be located in wrong place inside file system
      String qualifiedName = aClass.getQualifiedName();
      if (qualifiedName != null) qualifiedName = StringUtil.getPackageName(qualifiedName);
      if (Comparing.strEqual(qualifiedName, packageName)) {
        if (shortName == null || shortName.equals(aClass.getName())) list.add(aClass);
      }
    }
  }
  if (list == null) {
    return PsiClass.EMPTY_ARRAY;
  }

  if (list.size() > 1) {
    ContainerUtil.quickSort(list, new Comparator<PsiClass>() {
      @Override
      public int compare(PsiClass o1, PsiClass o2) {
        VirtualFile file1 = PsiUtilCore.getVirtualFile(o1);
        VirtualFile file2 = PsiUtilCore.getVirtualFile(o2);
        return file1 == null ? file2 == null ? 0 : -1 : file2 == null ? 1 : scope.compare(file2, file1);
      }
    });
  }

  return list.toArray(new PsiClass[list.size()]);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:36,代碼來源:PsiElementFinderImpl.java

示例8: canRun

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
protected void canRun() throws ConfigurationException {
  if (Comparing.strEqual(getNewName(), myOldName)) throw new ConfigurationException(null);
  if (!areButtonsValid()) {
    throw new ConfigurationException("\'" + getNewName() + "\' is not a valid identifier");
  }
  final Function<String, String> inputValidator = RenameInputValidatorRegistry.getInputErrorValidator(myPsiElement);
  if (inputValidator != null) {
    setErrorText(inputValidator.fun(getNewName()));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:RenameDialog.java

示例9: isConfiguredByElement

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean isConfiguredByElement(JUnitConfiguration configuration,
                                     PsiClass testClass,
                                     PsiMethod testMethod,
                                     PsiPackage testPackage,
                                     PsiDirectory testDir) {
  if (JUnitConfiguration.TEST_DIRECTORY.equals(configuration.getPersistentData().TEST_OBJECT) && testDir != null) {
    if (Comparing.strEqual(FileUtil.toSystemIndependentName(configuration.getPersistentData().getDirName()),
                           testDir.getVirtualFile().getPath())) {
      return true;
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:TestDirectory.java

示例10: findSdk

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
@Nullable
public Sdk findSdk(String sdkName) {
  for (Sdk projectJdk : myProjectSdks.values()) {
    if (Comparing.strEqual(projectJdk.getName(), sdkName)) return projectJdk;
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:ProjectSdksModel.java

示例11: annotationsToRemove

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
@NotNull
public String[] annotationsToRemove(Project project, @NotNull final String fqName) {
  final NullableNotNullManager manager = NullableNotNullManager.getInstance(project);
  if (manager.getNotNulls().contains(fqName)) {
    return ArrayUtil.toStringArray(manager.getNullables());
  }
  if (manager.getNullables().contains(fqName)) {
    return ArrayUtil.toStringArray(manager.getNotNulls()); 
  }
  if (Comparing.strEqual(fqName, AnnotationUtil.NLS)){
    return new String[]{AnnotationUtil.NON_NLS};
  }
  return ArrayUtil.EMPTY_STRING_ARRAY;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:OverrideImplementsAnnotationsHandlerImpl.java

示例12: isConfiguredByElement

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean isConfiguredByElement(PsiElement element) {
  element = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class, false);
  if (element instanceof PsiMethod) {
    final PsiClass aClass = ((PsiMethod) element).getContainingClass();
    final TestData data = myConfig.getPersistantData();
    return aClass != null &&
           Comparing.strEqual(data.MAIN_CLASS_NAME, JavaExecutionUtil.getRuntimeQualifiedName(aClass)) &&
           Comparing.strEqual(data.METHOD_NAME, ((PsiMethod) element).getName());
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:TestNGTestMethod.java

示例13: checkCannotInheritFromEnum

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
static HighlightInfo checkCannotInheritFromEnum(PsiClass superClass, PsiElement elementToHighlight) {
  HighlightInfo errorResult = null;
  if (Comparing.strEqual("java.lang.Enum", superClass.getQualifiedName())) {
    String message = JavaErrorMessages.message("classes.extends.enum");
    errorResult =
      HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(elementToHighlight).descriptionAndTooltip(message).create();
  }
  return errorResult;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:GenericsHighlightUtil.java

示例14: ConstructorParameterOnFieldRenameRenamer

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public ConstructorParameterOnFieldRenameRenamer(PsiField aField, String newFieldName) {
  final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(aField.getProject());
  final String propertyName = styleManager.variableNameToPropertyName(aField.getName(), VariableKind.FIELD);
  if (!Comparing.strEqual(propertyName, styleManager.variableNameToPropertyName(newFieldName, VariableKind.FIELD))) {
    final String paramName = styleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER);
    final PsiClass aClass = aField.getContainingClass();

    Set<PsiParameter> toRename = new HashSet<PsiParameter>();
    for (PsiMethod constructor : aClass.getConstructors()) {
      if (constructor instanceof PsiMirrorElement) {
        final PsiElement prototype = ((PsiMirrorElement)constructor).getPrototype();
        if (prototype instanceof PsiMethod && ((PsiMethod)prototype).isConstructor()) {
          constructor = (PsiMethod)prototype;
        }
        else {
          continue;
        }
      }
      if (constructor instanceof LightElement) continue;
      final PsiParameter[] parameters = constructor.getParameterList().getParameters();
      for (final PsiParameter parameter : parameters) {
        final String parameterName = parameter.getName();
        if (paramName.equals(parameterName) ||
          propertyName.equals(styleManager.variableNameToPropertyName(parameterName, VariableKind.PARAMETER))) {
          toRename.add(parameter);
        }
      }
    }
    myElements.addAll(toRename);

    suggestAllNames(aField.getName(), newFieldName);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:34,代碼來源:ConstructorParameterOnFieldRenameRenamer.java

示例15: isConfigurationFromContext

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean isConfigurationFromContext(TestNGConfiguration testNGConfiguration, ConfigurationContext context) {
  if (RunConfigurationProducer.getInstance(AbstractTestNGPatternConfigurationProducer.class).isMultipleElementsSelected(context)) {
    return false;
  }
  final RunConfiguration predefinedConfiguration = context.getOriginalConfiguration(TestNGConfigurationType.getInstance());
  final Location contextLocation = context.getLocation();
  if (contextLocation == null) {
    return false;
  }
  Location location = JavaExecutionUtil.stepIntoSingleClass(contextLocation);
  if (location == null) {
    return false;
  }
  final PsiElement element = location.getPsiElement();
  RunnerAndConfigurationSettings template = RunManager.getInstance(location.getProject()).getConfigurationTemplate(getConfigurationFactory());
  final Module predefinedModule = ((TestNGConfiguration)template.getConfiguration()).getConfigurationModule().getModule();
  final String vmParameters =
    predefinedConfiguration instanceof TestNGConfiguration ? ((TestNGConfiguration)predefinedConfiguration).getVMParameters() : null;
  if (vmParameters != null && !Comparing.strEqual(vmParameters, testNGConfiguration.getVMParameters())) return false;
  String paramSetName = contextLocation instanceof PsiMemberParameterizedLocation
                        ? getInvocationNumber(((PsiMemberParameterizedLocation)contextLocation).getParamSetName()) : null;
  if (paramSetName != null && !Comparing.strEqual(paramSetName, testNGConfiguration.getProgramParameters())) return false;
  TestNGTestObject testobject = TestNGTestObject.fromConfig(testNGConfiguration);
  if (testobject != null) {
    if (testobject.isConfiguredByElement(element)) {
      final Module configurationModule = testNGConfiguration.getConfigurationModule().getModule();
      if (Comparing.equal(location.getModule(), configurationModule)) return true;
      if (Comparing.equal(predefinedModule, configurationModule)) return true;
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:34,代碼來源:TestNGConfigurationProducer.java


注:本文中的com.intellij.openapi.util.Comparing.strEqual方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。