本文整理汇总了Java中com.intellij.psi.util.PsiTreeUtil.skipSiblingsForward方法的典型用法代码示例。如果您正苦于以下问题:Java PsiTreeUtil.skipSiblingsForward方法的具体用法?Java PsiTreeUtil.skipSiblingsForward怎么用?Java PsiTreeUtil.skipSiblingsForward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.util.PsiTreeUtil
的用法示例。
在下文中一共展示了PsiTreeUtil.skipSiblingsForward方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNextMeaningSibling
import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@Nullable
public static PsiElement getNextMeaningSibling(PsiElement element) {
return PsiTreeUtil.skipSiblingsForward(element, PsiWhiteSpace.class, PsiComment.class);
}
示例2: aroundIsValueLine
import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@Contract(pure = true)
public static boolean aroundIsValueLine(@Nullable final PsiElement element) {
if (element == null) {
return false;
}
if (isImpexValueLine(element)
|| isImpexValueLine(element.getParent())
|| isImpexValueLine(element.getParent().getParent())) {
return true;
}
boolean prevElementIsValueLine = false;
PsiElement prevSibling = PsiTreeUtil.skipSiblingsBackward(
element,
PsiWhiteSpace.class,
PsiComment.class,
ImpexBeanShell.class,
ImpexComment.class
);
while (null != prevSibling) {
if (isHeaderLine(prevSibling) || isImpexValueLine(prevSibling) || isUserRightsMacros(prevSibling)) {
prevElementIsValueLine = true;
break;
}
prevSibling = PsiTreeUtil.skipSiblingsBackward(
prevSibling,
PsiWhiteSpace.class,
PsiComment.class,
ImpexBeanShell.class,
ImpexComment.class
);
}
boolean nextElementIsValueLine = false;
PsiElement nextSibling = PsiTreeUtil.skipSiblingsForward(element,
PsiWhiteSpace.class, ImpexBeanShell.class,
ImpexComment.class
);
while (null != nextSibling) {
if (isImpexValueLine(nextSibling)) {
nextElementIsValueLine = true;
break;
}
if (isHeaderLine(nextSibling)) {
nextElementIsValueLine = false;
break;
}
if (isUserRightsMacros(nextSibling)) {
nextElementIsValueLine = false;
break;
}
nextSibling = PsiTreeUtil.skipSiblingsForward(nextSibling,
PsiWhiteSpace.class, ImpexBeanShell.class,
ImpexComment.class
);
}
return nextElementIsValueLine && prevElementIsValueLine;
}