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


Java Comparing.equal方法代碼示例

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


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

示例1: getFindNextModel

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public FindModel getFindNextModel(@NotNull final Editor editor) {
  if (myFindNextModel == null) return null;

  EditorSearchSession search = EditorSearchSession.get(editor);
  if (search != null && !isSelectNextOccurrenceWasPerformed) {
    String textInField = search.getTextInField();
    if (!Comparing.equal(textInField, myFindInFileModel.getStringToFind()) && !textInField.isEmpty()) {
      FindModel patched = new FindModel();
      patched.copyFrom(myFindNextModel);
      patched.setStringToFind(textInField);
      return patched;
    }
  }

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

示例2: isActionFiltered

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public static Condition<AnAction> isActionFiltered(final ActionManager actionManager,
                                                   final Keymap keymap,
                                                   final KeyboardShortcut keyboardShortcut) {
  return new Condition<AnAction>() {
    public boolean value(final AnAction action) {
      if (keyboardShortcut == null) return true;
      if (action == null) return false;
      final Shortcut[] actionShortcuts =
        keymap.getShortcuts(action instanceof ActionStub ? ((ActionStub)action).getId() : actionManager.getId(action));
      for (Shortcut shortcut : actionShortcuts) {
        if (shortcut instanceof KeyboardShortcut) {
          final KeyboardShortcut keyboardActionShortcut = (KeyboardShortcut)shortcut;
          if (Comparing.equal(keyboardActionShortcut, keyboardShortcut)) {
            return true;
          }
        }
      }
      return false;
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:ActionsTreeUtil.java

示例3: detectBaseDirectory

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
@Nullable
public Result detectBaseDirectory(final String patchFileName) {
  String[] nameComponents = patchFileName.split("/");
  String patchName = nameComponents[nameComponents.length - 1];
  if (patchName.isEmpty()) {
    return null;
  }
  final PsiFile[] psiFiles = FilenameIndex.getFilesByName(myProject, patchName, GlobalSearchScope.projectScope(myProject));
  if (psiFiles.length == 1) {
    PsiDirectory parent = psiFiles [0].getContainingDirectory();
    for(int i=nameComponents.length-2; i >= 0; i--) {
      if (!parent.getName().equals(nameComponents[i]) || Comparing.equal(parent.getVirtualFile(), myProject.getBaseDir())) {
        return new Result(parent.getVirtualFile().getPresentableUrl(), i+1);
      }
      parent = parent.getParentDirectory();
    }
    if (parent == null) return null;
    return new Result(parent.getVirtualFile().getPresentableUrl(), 0);
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:PsiPatchBaseDirectoryDetector.java

示例4: equals

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean equals(Object o) {
    if (!(o instanceof XrayServerConfig)) {
        return false;
    }
    XrayServerConfig other = (XrayServerConfig) o;

    return Comparing.equal(getUrl(), other.getUrl()) &&
            Comparing.equal(getPassword(), other.getPassword()) &&
            Comparing.equal(getUsername(), other.getUsername());
}
 
開發者ID:JFrogDev,項目名稱:jfrog-idea-plugin,代碼行數:12,代碼來源:XrayServerConfig.java

示例5: isModified

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public boolean isModified() {
  if (isIdeEncodingModified()) return true;
  if (isProjectEncodingModified()) return true;
  EncodingProjectManager encodingManager = EncodingProjectManager.getInstance(myProject);

  Map<VirtualFile, Charset> editing = myTreeView.getValues();
  Map<VirtualFile, Charset> existingMapping = getExistingMappingIncludingDefault(myProject);
  boolean same = editing.equals(existingMapping)
     && Comparing.equal(encodingManager.getDefaultCharsetForPropertiesFiles(null), mySelectedCharsetForPropertiesFiles.get())
     && encodingManager.isNative2AsciiForPropertiesFiles() == myTransparentNativeToAsciiCheckBox.isSelected()
    ;
  return !same;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:FileEncodingConfigurable.java

示例6: excludeFromCompilation

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
private static void excludeFromCompilation(@NotNull Project project, @NotNull VirtualFile dir) {
  final ExcludesConfiguration configuration =
    CompilerConfiguration.getInstance(project).getExcludedEntriesConfiguration();

  for (ExcludeEntryDescription description : configuration.getExcludeEntryDescriptions()) {
    if (Comparing.equal(description.getVirtualFile(), dir)) {
      return;
    }
  }
  configuration.addExcludeEntryDescription(new ExcludeEntryDescription(dir, true, false, project));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:AndroidCompileUtil.java

示例7: setOutputUrl

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public void setOutputUrl(String outputUrl) {
  if (!Comparing.equal(myOutputUrl, outputUrl)) {
    myOutputUrl = outputUrl;
    fireElementChanged();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:JpsJavaModuleExtensionImpl.java

示例8: setTestOutputUrl

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public void setTestOutputUrl(String testOutputUrl) {
  if (!Comparing.equal(myTestOutputUrl, testOutputUrl)) {
    myTestOutputUrl = testOutputUrl;
    fireElementChanged();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:JpsJavaModuleExtensionImpl.java

示例9: equals

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public boolean equals(Object obj) {
  if (!(obj instanceof PackageEntry)) {
    return false;
  }
  PackageEntry entry = (PackageEntry)obj;
  return entry.myWithSubpackages == myWithSubpackages
         && entry.isStatic() == isStatic()
         && Comparing.equal(entry.myPackageName, myPackageName);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:PackageEntry.java

示例10: doClassMigration

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public static void doClassMigration(Project project, PsiMigration migration, String newQName, UsageInfo[] usages) {
  try {
    PsiClass aClass = findOrCreateClass(project, migration, newQName);

    // rename all references
    for (UsageInfo usage : usages) {
      if (usage instanceof MigrationProcessor.MigrationUsageInfo) {
        final MigrationProcessor.MigrationUsageInfo usageInfo = (MigrationProcessor.MigrationUsageInfo)usage;
        if (Comparing.equal(newQName, usageInfo.mapEntry.getNewName())) {
          PsiElement element = usage.getElement();
          if (element == null || !element.isValid()) continue;
          if (element instanceof PsiJavaCodeReferenceElement) {
            final PsiJavaCodeReferenceElement referenceElement = (PsiJavaCodeReferenceElement)element;
            referenceElement.bindToElement(aClass);
          }
          else {
            bindNonJavaReference(aClass, element, usage);
          }
        }

      }
    }
  }
  catch (IncorrectOperationException e) {
    // should not happen!
    LOG.error(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:MigrationUtil.java

示例11: getGroupByActionId

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public String getGroupByActionId(String actionId) {
  for (T tool : getTools()) {
    if (Comparing.equal(actionId, tool.getActionId())) {
      return tool.getGroup();
    }
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:BaseToolManager.java

示例12: updatePropertiesPanel

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public void updatePropertiesPanel(final boolean force) {
  final PackagingElement<?> selected = getSelection().getElementIfSingle();
  if (!force && Comparing.equal(selected, mySelectedElementInfo.myElement)) {
    return;
  }
  mySelectedElementInfo.save();
  mySelectedElementInfo = new SelectedElementInfo<PackagingElement<?>>(selected);
  mySelectedElementInfo.showPropertiesPanel();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:LayoutTreeComponent.java

示例13: isModified

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public boolean isModified() {
  ExcludeEntryDescription[] excludeEntryDescriptions = myConfiguration.getExcludeEntryDescriptions();
  if(excludeEntryDescriptions.length != myExcludeEntryDescriptions.size()) {
    return true;
  }
  for(int i = 0; i < excludeEntryDescriptions.length; i++) {
    ExcludeEntryDescription description = excludeEntryDescriptions[i];
    if(!Comparing.equal(description, myExcludeEntryDescriptions.get(i))) {
      return true;
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ExcludedEntriesConfigurable.java

示例14: isDeleted

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
public boolean isDeleted(@NotNull FilePath path) {
  for (SvnChangedFile deletedFile : myDeletedFiles) {
    if (Comparing.equal(path, deletedFile.getFilePath())) {
      return true;
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:SvnChangeProviderContext.java

示例15: compare

import com.intellij.openapi.util.Comparing; //導入方法依賴的package包/類
@Override
public int compare(@NotNull VirtualFile file1, @NotNull VirtualFile file2) {
  VirtualFile r1 = getFileRoot(file1);
  VirtualFile r2 = getFileRoot(file2);
  if (Comparing.equal(r1, r2)) return 0;

  if (r1 == null) return -1;
  if (r2 == null) return 1;

  int i1 = myRoots.get(r1);
  int i2 = myRoots.get(r2);
  if (i1 == 0 && i2 == 0) return 0;
  if (i1 > 0 && i2 > 0) return i2 - i1;
  return i1 > 0 ? 1 : -1;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:ModuleWithDependenciesScope.java


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