本文整理汇总了Java中com.jetbrains.php.lang.parser.PhpElementTypes.CLASS_FIELDS属性的典型用法代码示例。如果您正苦于以下问题:Java PhpElementTypes.CLASS_FIELDS属性的具体用法?Java PhpElementTypes.CLASS_FIELDS怎么用?Java PhpElementTypes.CLASS_FIELDS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.jetbrains.php.lang.parser.PhpElementTypes
的用法示例。
在下文中一共展示了PhpElementTypes.CLASS_FIELDS属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPropertyValueCompletions
@Override
public void getPropertyValueCompletions(AnnotationPropertyParameter annotationPropertyParameter, AnnotationCompletionProviderParameter completionParameter) {
String propertyName = annotationPropertyParameter.getPropertyName();
if(propertyName == null) {
return;
}
if(propertyName.equals("name") && PhpLangUtil.equalsClassNames(annotationPropertyParameter.getPhpClass().getPresentableFQN(), "Doctrine\\ORM\\Mapping\\Column")) {
PhpDocComment phpDocComment = PsiTreeUtil.getParentOfType(annotationPropertyParameter.getElement(), PhpDocComment.class);
if(phpDocComment != null) {
PhpPsiElement classField = phpDocComment.getNextPsiSibling();
if(classField != null && classField.getNode().getElementType() == PhpElementTypes.CLASS_FIELDS) {
Field field = PsiTreeUtil.getChildOfType(classField, Field.class);
if(field != null) {
String name = field.getName();
if(StringUtils.isNotBlank(name)) {
completionParameter.getResult().addElement(LookupElementBuilder.create(underscore(name)));
}
}
}
}
}
}
示例2: isAvailable
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
if(!DoctrineUtil.isDoctrineOrmInVendor(project)) {
return false;
}
PsiElement parent = element.getParent();
if(parent == null || parent.getNode().getElementType() != PhpElementTypes.CLASS_FIELDS) {
return false;
}
Field field = PsiTreeUtil.getChildOfType(parent, Field.class);
return field != null && !DoctrineUtil.isOrmColumnProperty(field);
}
示例3: isClassMember
private static boolean isClassMember(PsiElement element)
{
if (element == null) {
return false;
} else {
IElementType elementType = element.getNode().getElementType();
return elementType == PhpElementTypes.CLASS_FIELDS || elementType == PhpElementTypes.CLASS_CONSTANTS || elementType == PhpStubElementTypes.CLASS_METHOD;
}
}
示例4: invoke
@Override
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement psiElement) throws IncorrectOperationException {
PsiElement parent = psiElement.getParent();
if(parent != null && parent.getNode().getElementType() == PhpElementTypes.CLASS_FIELDS) {
Field field = PsiTreeUtil.getChildOfType(parent, Field.class);
if(field != null) {
DoctrineUtil.importOrmUseAliasIfNotExists(field);
PhpDocUtil.addPropertyOrmDocs(field, editor.getDocument(), psiElement.getContainingFile());
}
}
}
示例5: isAnnotationPhpDocTag
public static boolean isAnnotationPhpDocTag(PhpDocTag phpDocTag) {
PhpDocComment phpDocComment = PsiTreeUtil.getParentOfType(phpDocTag, PhpDocComment.class);
if(phpDocComment == null) {
return false;
}
PsiElement nextPsiElement = phpDocComment.getNextPsiSibling();
if(nextPsiElement == null || !(nextPsiElement instanceof Method || nextPsiElement instanceof PhpClass || nextPsiElement.getNode().getElementType() == PhpElementTypes.CLASS_FIELDS)) {
return false;
}
return true;
}