本文整理汇总了Java中com.intellij.lang.properties.IProperty.getPsiElement方法的典型用法代码示例。如果您正苦于以下问题:Java IProperty.getPsiElement方法的具体用法?Java IProperty.getPsiElement怎么用?Java IProperty.getPsiElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.lang.properties.IProperty
的用法示例。
在下文中一共展示了IProperty.getPsiElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import com.intellij.lang.properties.IProperty; //导入方法依赖的package包/类
public PsiElement resolve() {
final Project project = myFile.getProject();
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
final VirtualFile formVirtualFile = myFile.getVirtualFile();
if (formVirtualFile == null) {
return null;
}
final Module module = fileIndex.getModuleForFile(formVirtualFile);
if (module == null) {
return null;
}
final PropertiesFile propertiesFile = PropertiesUtilBase.getPropertiesFile(myBundleName, module, null);
if (propertiesFile == null) {
return null;
}
IProperty property = propertiesFile.findPropertyByKey(getRangeText());
return property == null ? null : property.getPsiElement();
}
示例2: doResolve
import com.intellij.lang.properties.IProperty; //导入方法依赖的package包/类
@Override
protected PsiElement doResolve() {
PsiElement result = super.doResolve();
if (result != null) return result;
for (String each : myMavenProject.getFilterPropertiesFiles()) {
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(each);
if (file == null) continue;
IProperty property = MavenDomUtil.findProperty(myProject, file, myText);
if (property != null) return property.getPsiElement();
}
return null;
}
示例3: getNavigationElement
import com.intellij.lang.properties.IProperty; //导入方法依赖的package包/类
public PsiElement getNavigationElement(final String propertyName) {
DomTarget domTarget = DomTarget.getTarget(this);
if (domTarget == null) {
final GenericAttributeValue<String> environment = getEnvironment();
if (environment.getRawText() != null) {
domTarget = DomTarget.getTarget(this, environment);
}
if (domTarget == null) {
final GenericAttributeValue<String> resource = getResource();
if (resource.getRawText() != null) {
domTarget = DomTarget.getTarget(this, resource);
}
}
}
if (domTarget != null) {
final PsiElement psi = PomService.convertToPsi(domTarget);
if (psi != null) {
return psi;
}
}
final PsiFileSystemItem psiFile = getFile().getValue();
if (psiFile != null) {
final String prefix = getPropertyPrefixValue();
String _propertyName = propertyName;
if (prefix != null) {
if (!propertyName.startsWith(prefix)) {
return null;
}
_propertyName = propertyName.substring(prefix.length());
}
final PropertiesFile pf = toPropertiesFile(psiFile);
if (pf != null) {
final IProperty property = pf.findPropertyByKey(_propertyName);
return property != null? property.getPsiElement() : null;
}
}
return null;
}
示例4: findPropertyPsiElement
import com.intellij.lang.properties.IProperty; //导入方法依赖的package包/类
@Nullable
private PsiElement findPropertyPsiElement(final VirtualFile filter, final String propName) {
final IProperty property = MavenDomUtil.findProperty(myProject, filter, propName);
return property != null ? property.getPsiElement() : null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:MavenFilteredPropertiesCompletionAndResolutionTest.java