本文整理汇总了Java中com.intellij.psi.impl.source.jsp.jspJava.JspTemplateStatement类的典型用法代码示例。如果您正苦于以下问题:Java JspTemplateStatement类的具体用法?Java JspTemplateStatement怎么用?Java JspTemplateStatement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JspTemplateStatement类属于com.intellij.psi.impl.source.jsp.jspJava包,在下文中一共展示了JspTemplateStatement类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: statementCanBePlacedAlong
import com.intellij.psi.impl.source.jsp.jspJava.JspTemplateStatement; //导入依赖的package包/类
private static boolean statementCanBePlacedAlong(final PsiElement element) {
if (element instanceof JspTemplateStatement) {
PsiElement neighbour = element.getPrevSibling();
// we can place statement inside scriptlet only
return neighbour != null && !(neighbour instanceof JspTemplateStatement);
}
if (element instanceof PsiBlockStatement) return false;
final PsiElement parent = element.getParent();
if (parent instanceof JspClassLevelDeclarationStatement) return false;
if (parent instanceof PsiCodeBlock) return true;
if (parent instanceof PsiIfStatement &&
(element == ((PsiIfStatement)parent).getThenBranch() || element == ((PsiIfStatement)parent).getElseBranch())) {
return true;
}
if (parent instanceof PsiWhileStatement && element == ((PsiWhileStatement)parent).getBody()) {
return true;
}
if (parent instanceof PsiDoWhileStatement && element == ((PsiDoWhileStatement)parent).getBody()) {
return true;
}
// know nothing about that
return false;
}