本文整理汇总了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;
}
示例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;
}
};
}
示例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;
}
示例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());
}
示例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;
}
示例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));
}
示例7: setOutputUrl
import com.intellij.openapi.util.Comparing; //导入方法依赖的package包/类
@Override
public void setOutputUrl(String outputUrl) {
if (!Comparing.equal(myOutputUrl, outputUrl)) {
myOutputUrl = outputUrl;
fireElementChanged();
}
}
示例8: setTestOutputUrl
import com.intellij.openapi.util.Comparing; //导入方法依赖的package包/类
@Override
public void setTestOutputUrl(String testOutputUrl) {
if (!Comparing.equal(myTestOutputUrl, testOutputUrl)) {
myTestOutputUrl = testOutputUrl;
fireElementChanged();
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}