Java 类com.intellij.psi.PsiPostfixExpression 实例源码

项目:intellij-ce-playground    文件:ReplaceStaticVariableIncrementDecrement.java   
public ReplaceStaticVariableIncrementDecrement(PsiExpression reference, String originalClassName) {
  super(reference);
  this.originalClassName = originalClassName;
  final PsiPrefixExpression prefixExpr = PsiTreeUtil.getParentOfType(reference, PsiPrefixExpression.class);
  if (prefixExpr != null) {
    this.reference = prefixExpr;
  }
  else {
    this.reference = PsiTreeUtil.getParentOfType(reference, PsiPostfixExpression.class);
  }
}
项目:intellij-ce-playground    文件:ReplacePostfixExpressionWithOperatorAssignmentPredicate.java   
public boolean satisfiedBy(PsiElement element) {
  if (!(element instanceof PsiPostfixExpression)) {
    return false;
  }
  final PsiPostfixExpression postfixExpression = (PsiPostfixExpression)element;
  final IElementType tokenType = postfixExpression.getOperationTokenType();
  return !(!JavaTokenType.PLUSPLUS.equals(tokenType) && !JavaTokenType.MINUSMINUS.equals(tokenType));
}
项目:intellij-ce-playground    文件:ExtractIncrementIntention.java   
@Override
public String getTextForElement(PsiElement element) {
  final PsiJavaToken sign;
  if (element instanceof PsiPostfixExpression) {
    sign = ((PsiPostfixExpression)element).getOperationSign();
  }
  else {
    sign = ((PsiPrefixExpression)element).getOperationSign();
  }
  final String operator = sign.getText();
  return IntentionPowerPackBundle.message(
    "extract.increment.intention.name", operator);
}
项目:tools-idea    文件:ReplaceStaticVariableIncrementDecrement.java   
public ReplaceStaticVariableIncrementDecrement(PsiExpression reference, String originalClassName) {
  super(reference);
  this.originalClassName = originalClassName;
  final PsiPrefixExpression prefixExpr = PsiTreeUtil.getParentOfType(reference, PsiPrefixExpression.class);
  if (prefixExpr != null) {
    this.reference = prefixExpr;
  }
  else {
    this.reference = PsiTreeUtil.getParentOfType(reference, PsiPostfixExpression.class);
  }
}
项目:tools-idea    文件:ReplacePostfixExpressionWithOperatorAssignmentPredicate.java   
public boolean satisfiedBy(PsiElement element) {
  if (!(element instanceof PsiPostfixExpression)) {
    return false;
  }
  final PsiPostfixExpression postfixExpression = (PsiPostfixExpression)element;
  final IElementType tokenType = postfixExpression.getOperationTokenType();
  return !(!JavaTokenType.PLUSPLUS.equals(tokenType) && !JavaTokenType.MINUSMINUS.equals(tokenType));
}
项目:consulo-java    文件:ReplaceStaticVariableIncrementDecrement.java   
public ReplaceStaticVariableIncrementDecrement(PsiExpression reference, String originalClassName) {
  super(reference);
  this.originalClassName = originalClassName;
  final PsiPrefixExpression prefixExpr = PsiTreeUtil.getParentOfType(reference, PsiPrefixExpression.class);
  if (prefixExpr != null) {
    this.reference = prefixExpr;
  }
  else {
    this.reference = PsiTreeUtil.getParentOfType(reference, PsiPostfixExpression.class);
  }
}
项目:consulo-java    文件:ReplacePostfixExpressionWithOperatorAssignmentPredicate.java   
public boolean satisfiedBy(PsiElement element) {
  if (!(element instanceof PsiPostfixExpression)) {
    return false;
  }
  final PsiPostfixExpression postfixExpression = (PsiPostfixExpression)element;
  final IElementType tokenType = postfixExpression.getOperationTokenType();
  return !(!JavaTokenType.PLUSPLUS.equals(tokenType) && !JavaTokenType.MINUSMINUS.equals(tokenType));
}
项目:Android_Lint_SRP_Practice_Example    文件:PsiClassStructureDetector.java   
@Override
public void visitPostfixExpression(PsiPostfixExpression expression) {
    mVisitor.report("PsiPostfixExpression", expression.getText(), expression);
    super.visitExpression(expression);
}