本文整理汇总了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);
}
}
}
示例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);
}
}
}
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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()]);
}
示例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()));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}