当前位置: 首页>>代码示例>>Java>>正文


Java PhpClass.getPresentableFQN方法代码示例

本文整理汇总了Java中com.jetbrains.php.lang.psi.elements.PhpClass.getPresentableFQN方法的典型用法代码示例。如果您正苦于以下问题:Java PhpClass.getPresentableFQN方法的具体用法?Java PhpClass.getPresentableFQN怎么用?Java PhpClass.getPresentableFQN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jetbrains.php.lang.psi.elements.PhpClass的用法示例。


在下文中一共展示了PhpClass.getPresentableFQN方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getClassConfigurations

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
public static List<XmlTag> getClassConfigurations(PhpClass phpClass) {
    String classFqn = phpClass.getPresentableFQN();

    Collection<VirtualFile> containingFiles = FileBasedIndex.getInstance()
        .getContainingFiles(KEY, classFqn, GlobalSearchScope.allScope(phpClass.getProject())
    );

    PsiManager psiManager = PsiManager.getInstance(phpClass.getProject());

    List<XmlTag> tags = new ArrayList<XmlTag>();

    for (VirtualFile virtualFile: containingFiles) {
        XmlFile file = (XmlFile)psiManager.findFile(virtualFile);

        if (file == null) {
            continue;
        }

        XmlTag rootTag = file.getRootTag();
        fillRelatedTags(classFqn, rootTag, tags);
    }

    return tags;
}
 
开发者ID:magento,项目名称:magento2-phpstorm-plugin,代码行数:25,代码来源:TypeConfigurationIndex.java

示例2: getWebApiRoutes

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
/**
 * Get list of Web API routes associated with the provided method.
 *
 * Parent classes are not taken into account.
 */
public static List<XmlTag> getWebApiRoutes(Method method) {
    List<XmlTag> tags = new ArrayList<>();
    if (!method.getAccess().isPublic()) {
        return tags;
    }
    PhpClass phpClass = method.getContainingClass();
    String methodFqn = method.getName();
    if (phpClass == null) {
        return tags;
    }
    String classFqn = phpClass.getPresentableFQN();
    Collection<VirtualFile> containingFiles = FileBasedIndex
        .getInstance().getContainingFiles(KEY, classFqn, GlobalSearchScope.allScope(phpClass.getProject()));

    PsiManager psiManager = PsiManager.getInstance(phpClass.getProject());
    for (VirtualFile virtualFile : containingFiles) {
        XmlFile file = (XmlFile) psiManager.findFile(virtualFile);
        if (file == null) {
            continue;
        }
        XmlTag rootTag = file.getRootTag();
        fillRelatedTags(classFqn, methodFqn, rootTag, tags);
    }
    return tags;
}
 
开发者ID:magento,项目名称:magento2-phpstorm-plugin,代码行数:31,代码来源:WebApiTypeIndex.java

示例3: addCompletions

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
@Override
protected void addCompletions(
        @NotNull CompletionParameters parameters,
        ProcessingContext context,
        @NotNull CompletionResultSet result)
{
    PsiElement psiElement = parameters.getOriginalPosition();
    if (psiElement == null) {
        return;
    }

    PhpClass[] annotationsClasses = AnnotationUtil.getAnnotationsClasses(psiElement.getProject());

    for (PhpClass annotationsClass : annotationsClasses) {
        String annotationClassName = annotationsClass.getPresentableFQN();
        LookupElementBuilder lookupElement = LookupElementBuilder.createWithSmartPointer(
                annotationClassName,
                annotationsClass
        );
        lookupElement = lookupElement.withIcon(annotationsClass.getIcon());
        result.addElement(lookupElement);
    }
}
 
开发者ID:goaop,项目名称:idea-plugin,代码行数:24,代码来源:DoctrineAnnotationCompletionProvider.java

示例4: matches

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
@Override
public boolean matches(PhpNamedElement element) {
    if (!canMatchElement(element)) {
        return false;
    }
    PhpDocComment docComment = element.getDocComment();
    if (docComment == null) {
        return false;
    }

    List<PhpDocTag> docTagList = PsiTreeUtil.getChildrenOfTypeAsList(docComment, PhpDocTag.class);
    for (PhpDocTag phpDocTag : docTagList) {
        PhpClass annotationReference = AnnotationUtil.getAnnotationReference(phpDocTag);
        if (annotationReference == null || annotationReference.getPresentableFQN() == null) {
            continue;
        }
        String fqn = annotationReference.getFQN();
        if (fqn != null && fqn.equals(expectedClass)) {
            return true;
        };
    }

    return false;
}
 
开发者ID:goaop,项目名称:idea-plugin,代码行数:25,代码来源:AnnotationPointcut.java

示例5: getBlockClassDeclarations

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
public static List<XmlTag> getBlockClassDeclarations(PhpClass phpClass, Project project) {
    String className = phpClass.getPresentableFQN();

    List<XmlTag> blockTags = getComponentDeclarations(className, "block", BlockClassNameIndex.KEY, project, new ClassComponentMatcher());
    List<XmlTag> decoratedBlockTags = new ArrayList<>();
    for (XmlTag blockTag: blockTags) {
        decoratedBlockTags.add(new LayoutBlockLineMarkerXmlTagDecorator(blockTag));
    }
    return decoratedBlockTags;
}
 
开发者ID:magento,项目名称:magento2-phpstorm-plugin,代码行数:11,代码来源:LayoutIndex.java

示例6: collectCompletionResult

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
@Override
public List<LookupElement> collectCompletionResult(PsiElement psiElement, @Nullable PsiContextMatcherI<PsiElement> context) {
    List<LookupElement> result = new ArrayList<>();
    PhpIndex phpIndex = PhpIndex.getInstance(psiElement.getProject());
    String input = StringUtils.strip(psiElement.getText(), "\"");

    Collection<String> interfaceNames = phpIndex.getAllInterfaceNames();

    for (String interfaceName: interfaceNames) {
        if (!interfaceName.toLowerCase().contains(input.toLowerCase())) {
            continue;
        }

        Collection<PhpClass> classesByName = phpIndex.getInterfacesByName(interfaceName);
        for (PhpClass phpClass: classesByName) {
            if (context != null && !context.match(phpClass)) {
                continue;
            }

            String classFqn = phpClass.getPresentableFQN();

            result.add(
                LookupElementBuilder
                    .create(classFqn)
                    .withIcon(PhpIcons.INTERFACE_ICON)
            );
        }
    }

    return result;
}
 
开发者ID:dkvashninbay,项目名称:magento2plugin,代码行数:32,代码来源:InterfaceCompletionProvider.java

示例7: collectCompletionResult

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
@Override
public List<LookupElement> collectCompletionResult(PsiElement psiElement, @Nullable PsiContextMatcherI<PsiElement> context) {
    List<LookupElement> result = new ArrayList<>();
    PhpIndex phpIndex = PhpIndex.getInstance(psiElement.getProject());
    String prefix = StringUtil.unquoteString(psiElement.getText());

    Collection<String> classNames = phpIndex.getAllClassNames(new CamelHumpMatcher(prefix));

    for (String className: classNames) {
        Collection<PhpClass> classesByName = phpIndex.getClassesByName(className);
        for (PhpClass phpClass: classesByName) {
            if (context != null && !context.match(phpClass)) {
                continue;
            }

            String classFqn = phpClass.getPresentableFQN();

            result.add(
                LookupElementBuilder
                    .create(classFqn)
                    .withIcon(PhpIcons.CLASS_ICON)
            );
        }
    }

    return result;
}
 
开发者ID:dkvashninbay,项目名称:magento2plugin,代码行数:28,代码来源:ClassCompletionProvider.java

示例8: getClassConfigurations

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
@Nullable
public static List<XmlTag> getClassConfigurations(PhpClass phpClass) {
    String classFqn = phpClass.getPresentableFQN();

    Collection<VirtualFile> containingFiles = FileBasedIndex
        .getInstance()
        .getContainingFiles(
            NAME,
            classFqn,
            GlobalSearchScope.allScope(phpClass.getProject())
        );

    PsiManager psiManager = PsiManager.getInstance(phpClass.getProject());

    List<XmlTag> tags = new ArrayList<XmlTag>();

    for (VirtualFile virtualFile: containingFiles) {
        XmlFile file = (XmlFile)psiManager.findFile(virtualFile);

        if (file == null) {
            continue;
        }

        XmlTag rootTag = file.getRootTag();
        fillRelatedTags(classFqn, rootTag, tags);
    }

    return tags;
}
 
开发者ID:dkvashninbay,项目名称:magento2plugin,代码行数:30,代码来源:TypeConfigurationFileBasedIndex.java

示例9: getWebApiRoutes

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
/**
 * Get list of Web API routes associated with the provided method.
 *
 * Parent classes are not taken into account.
 */
public static List<XmlTag> getWebApiRoutes(Method method) {
    List<XmlTag> tags = new ArrayList<>();
    if (!method.getAccess().isPublic()) {
        return tags;
    }
    PhpClass phpClass = method.getContainingClass();
    String methodFqn = method.getName();
    if (phpClass == null) {
        return tags;
    }
    String classFqn = phpClass.getPresentableFQN();
    if (classFqn == null) {
        return tags;
    }
    Collection<VirtualFile> containingFiles = FileBasedIndex
        .getInstance()
        .getContainingFiles(
            NAME,
            classFqn,
            GlobalSearchScope.allScope(phpClass.getProject())
        );

    PsiManager psiManager = PsiManager.getInstance(phpClass.getProject());
    for (VirtualFile virtualFile : containingFiles) {
        XmlFile file = (XmlFile) psiManager.findFile(virtualFile);
        if (file == null) {
            continue;
        }
        XmlTag rootTag = file.getRootTag();
        fillRelatedTags(classFqn, methodFqn, rootTag, tags);
    }
    return tags;
}
 
开发者ID:dkvashninbay,项目名称:magento2plugin,代码行数:39,代码来源:WebApiTypesFileBasedIndex.java

示例10: getBlockClassDeclarations

import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
public static List<XmlTag> getBlockClassDeclarations(PhpClass phpClass, Project project) {
    String className = phpClass.getPresentableFQN();

    List<XmlTag> blockTags = getComponentDeclarations(className, "block", BlockClassFileBasedIndex.NAME, project, new ClassComponentMatcher());
    List<XmlTag> decoratedBlockTags = new ArrayList<>();
    for (XmlTag blockTag: blockTags) {
        decoratedBlockTags.add(new LayoutBlockLineMarkerXmlTagDecorator(blockTag));
    }
    return decoratedBlockTags;
}
 
开发者ID:dkvashninbay,项目名称:magento2plugin,代码行数:11,代码来源:LayoutIndexUtility.java


注:本文中的com.jetbrains.php.lang.psi.elements.PhpClass.getPresentableFQN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。