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