Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
56,700
XmlProcessingInstruction (String qualifiedName, Project project) { final String importText = "<?import " + qualifiedName + "?>"; final PsiElement child = PsiFileFactory.getInstance(project).createFileFromText("a.fxml", XMLLanguage.INSTANCE, importText).getFirstChild(); return PsiTreeUtil.findChildOfType(child, XmlProce...
createSingleImportInstruction
56,701
List<String> (XmlFile file) { return parseInstructions(file, "import"); }
parseImports
56,702
List<String> (XmlFile file) { return parseInstructions(file, "language"); }
parseInjectedLanguages
56,703
List<String> (XmlFile file, String instructionName) { final List<String> definedImports = new ArrayList<>(); final XmlDocument document = file.getDocument(); if (document != null) { final XmlProlog prolog = document.getProlog(); final Collection<XmlProcessingInstruction> instructions = new ArrayList<>(PsiTreeUtil.findC...
parseInstructions
56,704
PsiClass (String name, PsiElement context) { final Project project = context.getProject(); if (!StringUtil.getShortName(name).equals(name)) { final PsiClass psiClass = JavaPsiFacade.getInstance(project).findClass(name, GlobalSearchScope.allScope(project)); if (psiClass != null) { return psiClass; } return findNestedPsi...
findPsiClass
56,705
PsiClass (String name, PsiElement context, Project project) { final int dotIndex = name.indexOf('.'); if (dotIndex > 0) { final String outerName = name.substring(0, dotIndex); final PsiClass outerClass = findPsiClass(outerName, parseImports((XmlFile)context.getContainingFile()), context, project); if (outerClass != nul...
findNestedPsiClass
56,706
PsiClass (String name, List<String> imports, PsiElement context, Project project) { PsiClass psiClass = null; if (imports != null) { JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); PsiFile file = context.getContainingFile(); for (String anImport : imports) { if (StringUtil.getShortName(anImport).equals(na...
findPsiClass
56,707
void (XmlFile xmlFile, String shortName, String qualifiedName) { if (shortName != null && qualifiedName != null && findPsiClass(shortName, xmlFile.getRootTag()) == null) { final XmlDocument document = xmlFile.getDocument(); if (document != null) { final XmlProcessingInstruction processingInstruction = createSingleImpor...
insertImportWhenNeeded
56,708
PsiClass (PsiElement member) { final PsiClassType classType = getPropertyClassType(member); return classType != null ? classType.resolve() : null; }
getPropertyClass
56,709
PsiClassType (PsiElement member) { return getPropertyClassType(member, JavaFxCommonNames.JAVAFX_BEANS_PROPERTY_OBJECT_PROPERTY); }
getPropertyClassType
56,710
PsiClassType (PsiElement member, final String superTypeFQN) { if (member instanceof PsiMember) { final PsiType type = PropertyUtilBase.getPropertyType((PsiMember)member); if (type instanceof PsiClassType) { final PsiClassType.ClassResolveResult resolveResult = ((PsiClassType)type).resolveGenerics(); final PsiClass attr...
getPropertyClassType
56,711
PsiMethod (String attributeName, XmlTag context) { final String packageName = StringUtil.getPackageName(attributeName); if (context != null && !StringUtil.isEmptyOrSpaces(packageName)) { final PsiClass classWithStaticProperty = findPsiClass(packageName, context); if (classWithStaticProperty != null) { return findStatic...
findStaticPropertySetter
56,712
PsiMethod (@NotNull PsiClass psiClass, @Nullable String propertyName) { if (StringUtil.isEmpty(propertyName)) return null; PsiMethod getter = findPropertyGetter(psiClass, propertyName, null); if (getter != null) { return getter; } return findPropertyGetter(psiClass, propertyName, PsiTypes.booleanType()); }
findPropertyGetter
56,713
PsiMethod (final PsiClass psiClass, final String propertyName, final PsiType propertyType) { final String getterName = PropertyUtilBase.suggestGetterName(propertyName, propertyType); final PsiMethod[] getters = psiClass.findMethodsByName(getterName, true); for (PsiMethod getter : getters) { if (getter.hasModifierProper...
findPropertyGetter
56,714
PsiMethod (@NotNull PsiClass psiClass, @Nullable String propertyName) { if (StringUtil.isEmpty(propertyName)) return null; final PsiMethod[] getters = psiClass.findMethodsByName(propertyName + JavaFxCommonNames.PROPERTY_METHOD_SUFFIX, true); for (PsiMethod getter : getters) { if (getter.hasModifierProperty(PsiModifier....
findObservablePropertyGetter
56,715
PsiClass (final PsiFile containingFile) { if (containingFile instanceof XmlFile) { final XmlTag rootTag = ((XmlFile)containingFile).getRootTag(); final Project project = containingFile.getProject(); if (rootTag != null) { XmlAttribute attribute = rootTag.getAttribute(FxmlConstants.FX_CONTROLLER); if (attribute != null)...
getControllerClass
56,716
PsiClass (PsiFile containingFile, Project project, XmlAttribute attribute) { final String attributeValue = attribute.getValue(); if (!StringUtil.isEmptyOrSpaces(attributeValue)) { final GlobalSearchScope customScope = GlobalSearchScope.projectScope(project).intersectWith(containingFile.getResolveScope()); return JavaPs...
findControllerClass
56,717
boolean (@NotNull XmlAttribute attribute) { final PsiClass tagClass = getTagClass(attribute.getParent()); return tagClass != null && getEventHandlerPropertyType(tagClass, attribute.getName()) != null; }
isEventHandlerProperty
56,718
boolean (@NotNull PsiMember psiMember) { return psiMember.hasModifierProperty(PsiModifier.PUBLIC) || AnnotationUtil.isAnnotated(psiMember, JavaFxCommonNames.JAVAFX_FXML_ANNOTATION, 0); }
isVisibleInFxml
56,719
boolean (String attributeName, XmlTag tag) { if (findStaticPropertySetter(attributeName, tag) != null) return false; final XmlElementDescriptor descriptor = tag.getDescriptor(); if (descriptor instanceof JavaFxClassTagDescriptorBase) { return ((JavaFxClassTagDescriptorBase)descriptor).isReadOnlyAttribute(attributeName)...
isReadOnly
56,720
boolean (@Nullable String value) { return value != null && value.startsWith("${") && value.endsWith("}"); }
isExpressionBinding
56,721
boolean (@Nullable String value) { if (value == null || !value.startsWith("$")) return false; if (value.length() == 1) return true; final boolean expressionStarts = value.startsWith("${"); final boolean expressionEnds = value.endsWith("}"); if (expressionStarts && expressionEnds && value.length() == 3) return true; if ...
isIncorrectExpressionBinding
56,722
String (@Nullable PsiClass aClass) { if (aClass == null) { return null; } final PsiAnnotation annotation = AnnotationUtil.findAnnotationInHierarchy(aClass, Collections.singleton( JavaFxCommonNames.JAVAFX_BEANS_DEFAULT_PROPERTY)); if (annotation != null) { final PsiAnnotationMemberValue memberValue = annotation.findAttr...
getDefaultPropertyName
56,723
boolean (@NotNull PsiClass psiClass) { return isAbleToInstantiate(psiClass, message -> { }); }
isAbleToInstantiate
56,724
boolean (@NotNull PsiClass psiClass, @NotNull Consumer<? super String> messageConsumer) { if (psiClass.isEnum() || hasNamedArgOrNoArgConstructor(psiClass)) return true; final PsiMethod valueOf = findValueOfMethod(psiClass); if (valueOf == null) { if (!hasBuilder(psiClass)) { messageConsumer.accept(JavaFXBundle.message(...
isAbleToInstantiate
56,725
boolean (@NotNull PsiClass psiClass) { if (psiClass.getConstructors().length == 0) return true; return CachedValuesManager.getCachedValue(psiClass, () -> { for (PsiMethod constructor : psiClass.getConstructors()) { final PsiParameter[] parameters = constructor.getParameterList().getParameters(); if (parameters.length =...
hasNamedArgOrNoArgConstructor
56,726
boolean (final @NotNull PsiClass psiClass) { return CachedValuesManager.getCachedValue(psiClass, () -> { final Project project = psiClass.getProject(); final PsiClass builderClass = JavaPsiFacade.getInstance(project).findClass(JavaFxCommonNames.JAVAFX_FXML_BUILDER, GlobalSearchScope.allScope(project)); if (builderClass...
hasBuilder
56,727
boolean (@Nullable XmlTag targetTag, final @Nullable PsiClass fromClass) { return isClassAcceptable(targetTag, fromClass, (message, type) -> { }); }
isClassAcceptable
56,728
boolean (@Nullable XmlTag targetTag, final @Nullable PsiClass fromClass, @NotNull BiConsumer<? super String, ? super Validator.ValidationHost.ErrorType> messageConsumer) { if (targetTag == null || fromClass == null || !fromClass.isValid()) { return true; } final XmlElementDescriptor tagDescriptor = targetTag.getDescrip...
isClassAcceptable
56,729
boolean (@NotNull BiConsumer<? super String, ? super Validator.ValidationHost.ErrorType> messageConsumer) { messageConsumer.accept("Parent tag has no default property", Validator.ValidationHost.ErrorType.ERROR); return false; }
noDefaultPropertyError
56,730
boolean (@Nullable PsiType targetType, @NotNull PsiClass fromClass, @NotNull PsiElement context, @NotNull BiConsumer<? super String, ? super Validator.ValidationHost.ErrorType> messageConsumer) { if (targetType == null) return true; PsiType collectionItemType = JavaGenericsUtil.getCollectionItemType(targetType, fromCla...
canCoerce
56,731
boolean (@NotNull PsiType targetType, @NotNull PsiClass fromClass, @NotNull PsiElement context, @NotNull BiConsumer<? super String, ? super Validator.ValidationHost.ErrorType> messageConsumer) { if (targetType.equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || targetType.equalsToText(CommonClassNames.JAVA_LANG_STRING) ...
canCoerceImpl
56,732
boolean (@NotNull PsiType targetType, @NotNull PsiClass fromClass, @NotNull BiConsumer<? super String, ? super Validator.ValidationHost.ErrorType> messageConsumer) { messageConsumer.accept( JavaFXBundle.message("unable.to.coerce.error", HighlightUtil.formatClass(fromClass), targetType.getCanonicalText()), Validator.Val...
unableToCoerceError
56,733
boolean (@NotNull PsiType targetType, @NotNull PsiClass fromClass, @NotNull BiConsumer<? super @InspectionMessage String, ? super Validator.ValidationHost.ErrorType> messageConsumer) { messageConsumer.accept( JavaFXBundle.message("conversion.between.unrelated.types.error", HighlightUtil.formatClass(fromClass), targetTy...
unrelatedTypesWarning
56,734
boolean (final XmlAttributeValue element) { XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class); while (tag != null) { if (FxmlConstants.FX_DEFINE.equals(tag.getName())) { return true; } tag = tag.getParentTag(); } return false; }
isOutOfHierarchy
56,735
PsiType (final PsiField field, final Project project, final Map<String, PsiType> typeMap) { return CachedValuesManager.getCachedValue(field, () -> { final PsiType fieldType = field.getType(); final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(fieldType); final PsiClass fieldClass =...
getWrappedPropertyType
56,736
PsiType (@NotNull PsiMethod method) { return CachedValuesManager.getCachedValue(method, () -> { final PsiType returnType = eraseFreeTypeParameters(method.getReturnType(), method); return CachedValueProvider.Result.create(returnType, PsiModificationTracker.MODIFICATION_COUNT); }); }
getGetterReturnType
56,737
boolean (@NotNull PsiClass targetClass) { return Comparing.strEqual(targetClass.getQualifiedName(), CommonClassNames.JAVA_LANG_STRING) || findValueOfMethod(targetClass) != null; }
hasConversionFromAnyType
56,738
boolean (@Nullable PsiType psiType) { return psiType instanceof PsiPrimitiveType || PsiPrimitiveType.getUnboxedType(psiType) != null; }
isPrimitiveOrBoxed
56,739
Set<String> (@Nullable PsiClass psiClass) { if (psiClass != null) { return CachedValuesManager.getCachedValue(psiClass, () -> CachedValueProvider.Result.create( prepareConstructorNamedArgProperties(psiClass), PsiModificationTracker.MODIFICATION_COUNT)); } return Collections.emptySet(); }
getConstructorNamedArgProperties
56,740
Set<String> (@NotNull PsiClass psiClass) { final Set<String> properties = new HashSet<>(); for (PsiMethod constructor : psiClass.getConstructors()) { if (constructor.hasModifierProperty(PsiModifier.PUBLIC)) { final PsiParameter[] parameters = constructor.getParameterList().getParameters(); for (PsiParameter parameter :...
prepareConstructorNamedArgProperties
56,741
boolean (@NotNull PsiClass psiClass, @NotNull PsiType fieldType) { return isObservableCollection(PsiUtil.resolveClassInType(fieldType)) && JavaGenericsUtil.getCollectionItemType(fieldType, psiClass.getResolveScope()) != null || InheritanceUtil.isInheritor(fieldType, JavaFxCommonNames.JAVAFX_COLLECTIONS_OBSERVABLE_MAP);...
isWritablePropertyType
56,742
boolean (@Nullable PsiClass psiClass) { return psiClass != null && (InheritanceUtil.isInheritor(psiClass, JavaFxCommonNames.JAVAFX_COLLECTIONS_OBSERVABLE_LIST) || InheritanceUtil.isInheritor(psiClass, JavaFxCommonNames.JAVAFX_COLLECTIONS_OBSERVABLE_SET) || InheritanceUtil.isInheritor(psiClass, JavaFxCommonNames.JAVAFX_...
isObservableCollection
56,743
String (@NotNull String memberName, boolean isMethod) { if (!isMethod) return memberName; final String propertyName = PropertyUtilBase.getPropertyName(memberName); return propertyName != null ? propertyName : memberName; }
getPropertyName
56,744
boolean (@NotNull PsiClass psiClass) { final Project project = psiClass.getProject(); final GlobalSearchScope resolveScope = psiClass.getResolveScope(); if (isControllerClassName(project, psiClass.getQualifiedName(), resolveScope)) { return true; } final Ref<Boolean> refFound = new Ref<>(false); ClassInheritorsSearch.s...
isControllerClass
56,745
boolean (@NotNull Project project, @Nullable String qualifiedName, @NotNull GlobalSearchScope resolveScope) { return qualifiedName != null && !JavaFxControllerClassIndex.findFxmlWithController(project, qualifiedName, resolveScope).isEmpty(); }
isControllerClassName
56,746
boolean (@NotNull PsiReference loaderReference, @NotNull Ref<? super PsiClass> injectedController, PsiMethod injectControllerMethod) { final PsiElement element = loaderReference.getElement(); if (element instanceof PsiReferenceExpression) { final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfTyp...
findControllerClassInjection
56,747
boolean (@NotNull PsiFile file) { return file instanceof PsiJavaFile && CachedValuesManager.getCachedValue(file, () -> { PsiImportList importList = ((PsiJavaFile)file).getImportList(); boolean javafx = importList != null && ContainerUtil.exists(importList.getAllImportStatements(), s -> { PsiJavaCodeReferenceElement ref...
isJavaFxPackageImported
56,748
String[][] (@NotNull XmlFile file) { return JavaFxFileTypeFactory.isFxml(file) ? NAMESPACES : null; }
getDefaultNamespaces
56,749
boolean (@NotNull XmlFile file) { return false; }
overrideNamespaceFromDocType
56,750
void (@NotNull MetaDataRegistrar registrar) { registrar.registerMetaData(new RootTagFilter(new NamespaceFilter(JAVAFX_NAMESPACE)), JavaFxNamespaceDescriptor.class); }
contributeMetaData
56,751
boolean (final PsiFile file) { return JavaFxFileTypeFactory.isFxml(file); }
isAvailable
56,752
TagNameReference (final ASTNode nameElement, final boolean startTagFlag) { return new JavaFxTagNameReference(nameElement, startTagFlag); }
createTagNameReference
56,753
void (final @NotNull MultiHostRegistrar registrar, final @NotNull PsiElement host) { if (Holder.SCRIPT_PATTERN.accepts(host)) { final List<String> registeredLanguages = JavaFxPsiUtil.parseInjectedLanguages((XmlFile)host.getContainingFile()); for (Language language : Language.getRegisteredLanguages()) { for (String regi...
getLanguagesToInject
56,754
boolean (@NotNull Project project, @NotNull VirtualFile file) { return isFxml(file); }
describes
56,755
boolean (@NotNull PsiFile file) { final VirtualFile virtualFile = file.getViewProvider().getVirtualFile(); return isFxml(virtualFile); }
isFxml
56,756
boolean (@NotNull VirtualFile virtualFile) { if (virtualFile.getName().endsWith(DOT_FXML_EXTENSION)) { FileType fileType = virtualFile.getFileType(); return fileType == getFileType() && !fileType.isBinary(); } return false; }
isFxml
56,757
FileType () { return FileTypeManager.getInstance().getFileTypeByExtension(FXML_EXTENSION); }
getFileType
56,758
PsiElement () { return mySetter; }
getDeclaration
56,759
PsiClass () { if (mySetter != null) { final PsiParameter[] parameters = mySetter.getParameterList().getParameters(); if (parameters.length == 2) { final PsiClass enumClass = PsiUtil.resolveClassInType(parameters[1].getType()); return enumClass != null && enumClass.isEnum() ? enumClass : null; } } return null; }
getEnum
56,760
PsiClass () { return myPsiClass; }
getPsiClass
56,761
boolean () { return myStatic; }
isStatic
56,762
String () { return getName(); }
getQualifiedName
56,763
String () { return getName(); }
getDefaultName
56,764
XmlElementDescriptor[] (XmlTag context) { final PsiElement declaration = getDeclaration(); final PsiType propertyType = JavaFxPsiUtil.getWritablePropertyType(myPsiClass, declaration); if (propertyType != null) { final ArrayList<XmlElementDescriptor> descriptors = new ArrayList<>(); for (String name : FxmlConstants.FX_B...
getElementsDescriptors
56,765
void (@Nullable PsiType psiType, final @NotNull List<XmlElementDescriptor> descriptors, @NotNull PsiElement context) { final PsiClass aClass = PsiUtil.resolveClassInType(psiType); if (aClass != null) { if (CommonClassNames.JAVA_LANG_OBJECT.equals(aClass.getQualifiedName())) { collectRawPropertyDescriptors(descriptors, ...
collectSubclassesDescriptors
56,766
void (@NotNull List<XmlElementDescriptor> descriptors, @NotNull PsiElement context) { final Project project = context.getProject(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(project); final GlobalSearchScope scope = GlobalSearchScope.allScope(project); // Offer most used simple types. TODO try to guess sui...
collectRawPropertyDescriptors
56,767
void (@NotNull List<XmlElementDescriptor> descriptors, @Nullable PsiClass aClass) { if (aClass != null && !CommonClassNames.JAVA_LANG_OBJECT.equals(aClass.getQualifiedName()) && !aClass.isInterface() && !PsiUtil.isAbstractClass(aClass) && !PsiUtil.isInnerClass(aClass) && JavaFxPsiUtil.isAbleToInstantiate(aClass)) { des...
addElementDescriptor
56,768
XmlAttributeDescriptor[] (@Nullable XmlTag context) { return XmlAttributeDescriptor.EMPTY; }
getAttributesDescriptors
56,769
XmlNSDescriptor () { return null; }
getNSDescriptor
56,770
int () { return CONTENT_TYPE_UNKNOWN; }
getContentType
56,771
PsiElement () { if (myPsiClass == null) return null; if (myStatic) return JavaFxPsiUtil.findStaticPropertySetter(myName, myPsiClass); return JavaFxPsiUtil.getWritableProperties(myPsiClass).get(myName); }
getDeclaration
56,772
String (PsiElement context) { return getName(); }
getName
56,773
String () { if (myPsiClass != null && myStatic) { return StringUtil.getQualifiedName(myPsiClass.getName(), StringUtil.notNullize(myName)); } return myName; }
getName
56,774
void (PsiElement element) {}
init
56,775
String () { return "<" + (myStatic ? "static " : "") + (myPsiClass != null ? myPsiClass.getName() + "#" : "?#") + myName + ">"; }
toString
56,776
PsiClass () { final String className = myXmlTag.getAttributeValue(FxmlConstants.TYPE); return className != null ? JavaFxPsiUtil.findPsiClass(className, myXmlTag) : null; }
getPsiClass
56,777
XmlAttributeDescriptor[] (@Nullable XmlTag context) { return Stream.concat(Arrays.stream(super.getAttributesDescriptors(context)), Stream.of(new RootTagTypeAttributeDescriptor())) .toArray(XmlAttributeDescriptor.ARRAY_FACTORY::create); }
getAttributesDescriptors
56,778
boolean (String attributeName) { return !FxmlConstants.TYPE.equals(attributeName) && super.isReadOnlyAttribute(attributeName); }
isReadOnlyAttribute
56,779
void (@NotNull XmlTag context, @NotNull ValidationHost host) { super.validate(context, host); if (context.getParentTag() != null) { host.addMessage(context.getNavigationElement(), JavaFXBundle.message("inspection.message.fx.root.valid.only.as.root.node.fxml.document"), ValidationHost.ErrorType.ERROR); } }
validate
56,780
String () { final PsiClass psiClass = getPsiClass(); return "<" + getName() + " -> " + (psiClass != null ? psiClass.getName() : myXmlTag.getAttributeValue(FxmlConstants.TYPE) + "?") + ">"; }
toString
56,781
PsiElement () { final PsiClass psiClass = getPsiClass(); return psiClass != null ? psiClass : myXmlTag; }
getDeclaration
56,782
boolean () { return false; }
isEnumerated
56,783
boolean () { return true; }
isRequired
56,784
PsiClass () { return null; }
getEnum
56,785
boolean (PsiField field) { return false; }
isConstant
56,786
String () { return FxmlConstants.FX_ROOT + "#" + getName(); }
toString
56,787
PsiElement () { return myPsiMethod != null && myPsiMethod.isValid() ? myPsiMethod : null; }
getDeclaration
56,788
PsiClass () { return myPsiClass; }
getPsiClass
56,789
boolean () { return false; }
isRequired
56,790
boolean () { return false; }
isFixed
56,791
boolean () { return false; }
hasIdType
56,792
boolean () { return false; }
hasIdRefType
56,793
boolean () { return getEnumeratedValues() != null; }
isEnumerated
56,794
boolean (PsiField field) { return field instanceof PsiEnumConstant; }
isConstant
56,795
PsiClass () { final PsiClass aClass = JavaFxPsiUtil.getPropertyClass(getDeclaration()); return aClass != null && aClass.isEnum() ? aClass : null; }
getEnum
56,796
PsiElement (XmlElement xmlElement, String value) { if (value != null && value.startsWith("%")) return xmlElement; final PsiClass aClass = getEnum(); if (aClass != null) { final PsiField fieldByName = aClass.findFieldByName(value, true); return fieldByName != null ? fieldByName : aClass.findFieldByName(StringUtil.toUppe...
getEnumeratedValueDeclaration
56,797
boolean (@NotNull List<String> propertyNames) { return propertyNames.isEmpty() || propertyNames.contains(""); }
isIncompletePropertyChain
56,798
PsiElement () { return getDeclarationMember(); }
getDeclaration
56,799
PsiMember () { return JavaFxPsiUtil.getWritableProperties(myPsiClass).get(myName); }
getDeclarationMember