本文整理汇总了Java中com.intellij.psi.impl.FakePsiElement类的典型用法代码示例。如果您正苦于以下问题:Java FakePsiElement类的具体用法?Java FakePsiElement怎么用?Java FakePsiElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FakePsiElement类属于com.intellij.psi.impl包,在下文中一共展示了FakePsiElement类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import com.intellij.psi.impl.FakePsiElement; //导入依赖的package包/类
public PsiElement resolve() {
return new FakePsiElement() {
public PsiElement getParent() {
return myElement;
}
@Override
public String getName() {
return myText;
}
@Override
public void navigate(boolean requestFocus) {
BrowserUtil.launchBrowser(myText);
}
};
}
示例2: getMavenElementDescription
import com.intellij.psi.impl.FakePsiElement; //导入依赖的package包/类
@Nullable
private static String getMavenElementDescription(PsiElement e, DescKind kind, boolean html) {
e = getMavenElement(e);
if (e == null) return null;
if (e instanceof FakePsiElement) {
return ((FakePsiElement)e).getPresentableText();
}
boolean property = MavenDomUtil.isMavenProperty(e);
String type = property ? "Property" : "Model Property";
if (kind == DescKind.TYPE) return type;
String name = buildPropertyName(e, property);
if (kind == DescKind.NAME) return name;
if (kind == DescKind.TYPE_NAME_VALUE) {
String br = html ? "<br>" : "\n ";
String[] bold = html ? new String[]{"<b>", "</b>"} : new String[]{"", ""};
String valueSuffix = "";
if (e instanceof XmlTag) {
valueSuffix = ": " + bold[0] + ((XmlTag)e).getValue().getTrimmedText() + bold[1];
}
return type + br + name + valueSuffix;
}
MavenLog.LOG.error("unexpected desc kind: " + kind);
return null;
}
示例3: processElementsWithName
import com.intellij.psi.impl.FakePsiElement; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name, @NotNull final Processor<NavigationItem> processor, @NotNull FindSymbolParameters parameters)
{
StubIndex.getInstance().processElements(UnityScriptIndexKeys.FILE_BY_NAME_INDEX, name, parameters.getProject(), parameters.getSearchScope(), parameters.getIdFilter(), JSFile.class,
new Processor<JSFile>()
{
@Override
public boolean process(final JSFile file)
{
return processor.process(new FakePsiElement()
{
@Override
public String getName()
{
return FileUtil.getNameWithoutExtension(file.getName());
}
@Nullable
@Override
public Icon getIcon(boolean open)
{
IconDescriptor descriptor = new IconDescriptor(AllIcons.Nodes.Class);
descriptor.addLayerIcon(Unity3dIcons.Js);
descriptor.setRightIcon(AllIcons.Nodes.C_public);
return descriptor.toIcon();
}
@Override
public PsiElement getParent()
{
return file;
}
});
}
});
}