本文整理匯總了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;
}