本文整理汇总了Java中com.intellij.psi.PsiElement.getNode方法的典型用法代码示例。如果您正苦于以下问题:Java PsiElement.getNode方法的具体用法?Java PsiElement.getNode怎么用?Java PsiElement.getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.PsiElement
的用法示例。
在下文中一共展示了PsiElement.getNode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHeaderTypeNamePsiElementOfAttribute
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@Nullable
@Contract("null -> null")
protected ImpexHeaderTypeName getHeaderTypeNamePsiElementOfAttribute(@Nullable final PsiElement headerAttributePsiElement) {
if (null == headerAttributePsiElement || null == headerAttributePsiElement.getNode()) {
return null;
}
final ImpexHeaderLine impexHeaderLine = PsiTreeUtil.getParentOfType(
headerAttributePsiElement,
ImpexHeaderLine.class
);
if (null == impexHeaderLine) {
return null;
}
final ImpexFullHeaderType impexFullHeaderType = impexHeaderLine.getFullHeaderType();
return null == impexFullHeaderType ? null : impexFullHeaderType.getHeaderTypeName();
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:21,代码来源:ImpexHeaderItemTypeAttributeNameCompletionProvider.java
示例2: createModel
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@NotNull
@Override
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
final Block impexBlock = new ImpexBlock(
element.getNode(),
null,
Alignment.createAlignment(),
createSpaceBuilder(settings)
);
return FormattingModelProvider.createFormattingModelForPsiFile(
element.getContainingFile(),
impexBlock,
settings
);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:18,代码来源:ImpexFormattingModelBuilder.java
示例3: handleElementRename
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@Override
public PsiElement handleElementRename(String newName) throws IncorrectOperationException {
PsiElement newNameIdentifier = RmlElementFactory.createTypeName(myElement.getProject(), newName);
ASTNode newNameNode = newNameIdentifier.getFirstChild().getNode();
PsiElement nameIdentifier = myElement.getNameIdentifier();
if (nameIdentifier == null) {
myElement.getNode().addChild(newNameNode);
} else {
ASTNode oldNameNode = nameIdentifier.getNode();
myElement.getNode().replaceChild(oldNameNode, newNameNode);
}
return myElement;
}
示例4: handleElementRename
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@Override
public PsiElement handleElementRename(String newName) throws IncorrectOperationException {
PsiElement newNameIdentifier = RmlElementFactory.createModuleName(myElement.getProject(), newName);
ASTNode newNameNode = newNameIdentifier.getFirstChild().getNode();
PsiElement nameIdentifier = myElement.getNameIdentifier();
if (nameIdentifier == null) {
myElement.getNode().addChild(newNameNode);
} else {
ASTNode oldNameNode = nameIdentifier.getNode();
myElement.getNode().replaceChild(oldNameNode, newNameNode);
}
return myElement;
}
示例5: foldRouteReferenceString
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@Nullable
private FoldingDescriptor foldRouteReferenceString(PsiReference reference, String value, FoldingGroup group) {
PsiElement element = reference.getElement();
TextRange foldingRange = new TextRange(element.getTextRange().getStartOffset() + 1, element.getTextRange().getEndOffset() - 1);
if (!RouteIndex.hasRoute(element.getProject(), value)) {
return null;
}
Collection<RouteStub> route = RouteIndex.getRoute(element.getProject(), value);
if (route.size() == 0) {
return null;
}
RouteStub routeDef = route.iterator().next();
return new FoldingDescriptor(element.getNode(), foldingRange, group) {
@Nullable
@Override
public String getPlaceholderText() {
if (routeDef.getPath() == null) {
return routeDef.getController() + "::" + routeDef.getMethod();
}
return routeDef.getPath();
}
};
}
示例6: createModel
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@NotNull
@Override
public FormattingModel createModel(
final PsiElement element, final CodeStyleSettings settings
) {
final Block block = new FlexibleSearchBlock(
element.getNode(),
null,
Alignment.createAlignment(),
createSpaceBuilder(settings)
);
return FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile(), block, settings);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:15,代码来源:FlexibleSearchFormattingModelBuilder.java
示例7: ImpexFoldingDescriptor
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
public ImpexFoldingDescriptor(
@NotNull final PsiElement psiElement,
@NotNull final FoldingGroup group
) {
super(
psiElement.getNode(),
new TextRange(
psiElement.getTextRange().getStartOffset(),
psiElement.getTextRange().getEndOffset()
),
group
);
placeholder = ImpexFoldingPlaceholderBuilderFactory.getPlaceholderBuilder().getPlaceholder(psiElement);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:16,代码来源:ImpexFoldingDescriptor.java
示例8: findParameterNode
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
@Nullable
@Override
public ASTNode findParameterNode() {
PsiElement parameter = getParameter();
return parameter != null ? parameter.getNode() : null;
}
示例9: getElementType
import com.intellij.psi.PsiElement; //导入方法依赖的package包/类
public static IElementType getElementType(PsiElement element) {
return element == null || element.getNode() == null ? null : element.getNode().getElementType();
}