本文整理汇总了Java中com.intellij.psi.util.PsiTreeUtil.skipSiblingsBackward方法的典型用法代码示例。如果您正苦于以下问题:Java PsiTreeUtil.skipSiblingsBackward方法的具体用法?Java PsiTreeUtil.skipSiblingsBackward怎么用?Java PsiTreeUtil.skipSiblingsBackward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.util.PsiTreeUtil
的用法示例。
在下文中一共展示了PsiTreeUtil.skipSiblingsBackward方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prevElementIsUserRightsMacros
import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@Nullable
@Contract(pure = true)
public static boolean prevElementIsUserRightsMacros(@NotNull final PsiElement element) {
Validate.notNull(element);
final Class[] skipClasses = {ImpexValueLine.class, PsiComment.class, PsiWhiteSpace.class};
PsiElement prevElement = PsiTreeUtil.skipSiblingsBackward(element, skipClasses);
while (null != prevElement) {
if (isHeaderLine(prevElement)) {
return false;
}
if (isUserRightsMacros(prevElement)) {
return true;
}
prevElement = PsiTreeUtil.skipSiblingsBackward(prevElement, skipClasses);
}
return false;
}
示例2: adjustWhiteSpaceAndSeparator
import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
private static PsiElement adjustWhiteSpaceAndSeparator(PsiElement psi) {
if (psi instanceof PsiWhiteSpace) {
//white space should be adjusted to left
PsiElement prev = PsiTreeUtil.skipSiblingsBackward(psi, PsiWhiteSpace.class);
if (prev != null) {
psi = prev;
}
} else if (psi.getNode().getElementType() == ImpexTypes.PARAMETERS_SEPARATOR && psi.getNextSibling() != null) {
//separator is always belongs to the *next* parameter, so adjusting to right
psi = psi.getNextSibling();
}
return psi;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:14,代码来源:ImpexColumnBreadcrumbsProvider.java
示例3: getPrevMeaningSibling
import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@Nullable
public static PsiElement getPrevMeaningSibling(PsiElement element) {
return PsiTreeUtil.skipSiblingsBackward(element, PsiWhiteSpace.class, PsiComment.class);
}
示例4: 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;
}