Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.MethodInvocation


      Assignment assignment = ast.newAssignment();

      ExpressionStatement statement = ast.newExpressionStatement(assignment);
      block.statements().add(statement);

      MethodInvocation invocation = getterInfo.toMethodInvocation(ast, name);
      assignment.setRightHandSide(invocation);
      assignment.setOperator(Operator.ASSIGN);

      SimpleName assignTo = fieldInfo.toSimpleName(ast);
      assignment.setLeftHandSide(assignTo);
View Full Code Here


    return method;
  }

  @Override
  public MethodInvocation toMethodInvocation(AST ast, SimpleName variableName) {
    MethodInvocation invocation = ast.newMethodInvocation();
    invocation.setExpression(variableName);
    invocation.setName(ast.newSimpleName(name));
    return invocation;
  }
View Full Code Here

        ie.getRightOperand());

    final NumberLiteral zero = ast.newNumberLiteral();
    astRewrite.replace(ie.getRightOperand(), zero, null);

    final MethodInvocation newInvocation = ast.newMethodInvocation();
    newInvocation.setExpression(leftExpCopy);
    newInvocation.setName(ast.newSimpleName("compareTo")); //$NON-NLS-1$
    newInvocation.arguments().add(rightExpCopy);

    astRewrite.replace(ie.getLeftOperand(), newInvocation, null);

    if (((ASTNode) newInvocation.arguments().get(0)).getNodeType() == ASTNode.SIMPLE_NAME
        && this.fieldsToRefactor.contains(((SimpleName) ie
            .getRightOperand()).resolveBinding().getJavaElement()))
      this.rewriteReference(astRewrite, importRewrite,
          (SimpleName) newInvocation.arguments().get(0),
          fullyQualifiedTypeName);

    if (((ASTNode) newInvocation.getExpression()).getNodeType() == ASTNode.SIMPLE_NAME
        && this.fieldsToRefactor.contains(((SimpleName) ie
            .getLeftOperand()).resolveBinding().getJavaElement()))
      this.rewriteReference(astRewrite, importRewrite,
          (SimpleName) newInvocation.getExpression(),
          fullyQualifiedTypeName);

    return status;
  }
View Full Code Here

          this.findFormalsForVariable(smi);
      break;
    }

    case ASTNode.METHOD_INVOCATION: {
      final MethodInvocation mi = (MethodInvocation) node;

      // if coming up from a argument.
      if (containedIn(mi.arguments(), this.name)) {
        // if we don't have the source, no can do.
        if (!mi.resolveMethodBinding().getDeclaringClass()
            .isFromSource())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
        else
          // go find the formals.
View Full Code Here

            Messages.ASTNodeProcessor_IllegalInfixExpression, op, node);
      break;
    }

    case ASTNode.METHOD_INVOCATION: {
      final MethodInvocation m = (MethodInvocation) node;
      final IMethod meth = (IMethod) m.resolveMethodBinding()
          .getJavaElement();
      final IMethod top = Util.getTopMostSourceMethod(meth, this.monitor);

      if (top == null)
        throw new DefinitelyNotEnumerizableException(
View Full Code Here

  private void addLocationProperties(List<Property> properties,
      WidgetInfo widget,
      boolean horizontal,
      String title) {
    MethodInvocation invocation = getLocationInvocation(widget, horizontal);
    if (invocation == null) {
      return;
    }
    String signature = AstNodeUtils.getMethodSignature(invocation);
    //
View Full Code Here

    }, x + " x " + y);
  }

  private String getLocationHint(int pixels, WidgetInfo widget, boolean horizontal)
      throws Exception {
    MethodInvocation invocation = getLocationInvocation(widget, horizontal);
    // may be trailing
    if (isLocationTrailing(invocation)) {
      if (horizontal) {
        pixels = getBounds().width - (widget.getBounds().width + pixels);
      } else {
View Full Code Here

  /**
   * @return <code>true</code> if {@link WidgetInfo} is attached to trailing size of panel.
   */
  public boolean getLocationHint_isTrailing(WidgetInfo widget, boolean horizontal) {
    MethodInvocation invocation = getLocationInvocation(widget, horizontal);
    return isLocationTrailing(invocation);
  }
View Full Code Here

    }
    return getUnitByName("PX");
  }

  MethodInvocation getLocationInvocation(WidgetInfo widget, boolean horizontal) {
    MethodInvocation invocation;
    if (horizontal) {
      if ((invocation = getWidgetInvocation(widget, "setWidgetLeftWidth")) != null) {
        return invocation;
      }
      if ((invocation = getWidgetInvocation(widget, "setWidgetRightWidth")) != null) {
View Full Code Here

  }

  private void command_LOCATION_X(WidgetInfo widget, int x) throws Exception {
    // LeftWidth
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetLeftWidth");
      if (invocation != null) {
        setInvocationArgument(invocation, 1, x, true);
        return;
      }
    }
    // RightWidth
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetRightWidth");
      if (invocation != null) {
        int right = getBounds().width - x - widget.getBounds().width;
        setInvocationArgument(invocation, 1, right, true);
        return;
      }
    }
    // LeftRight
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetLeftRight");
      if (invocation != null) {
        int right = getBounds().width - x - widget.getBounds().width;
        setInvocationArgument(invocation, 1, x, true);
        setInvocationArgument(invocation, 3, right, true);
        return;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.MethodInvocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.