Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()


    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);
View Full Code Here


   */
  private static ExpressionInfo getExpressionInfo(JavaInfo component, Expression expression) {
    if (expression instanceof MethodInvocation) {
      MethodInvocation invocation = (MethodInvocation) expression;
      // check invocation
      if (invocation.arguments().size() != 0) {
        return null;
      }
      if (!(invocation.getExpression() instanceof SimpleName)) {
        return null;
      }
View Full Code Here

        } else {
            valueOfInvocation.setExpression(ast.newSimpleName(binding.getName()));
        }

        List<?> arguments = primitiveTypeCreation.arguments();
        List<Expression> newArguments = valueOfInvocation.arguments();
        for (Object argument : arguments) {
            Expression expression = (Expression) rewrite.createCopyTarget((ASTNode) argument);
            newArguments.add(expression);
        }
View Full Code Here

  private boolean setSizeInts(int width, int height) throws Exception {
    MethodInvocation invocation = m_window.getMethodInvocation("setSize(int,int)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression((Expression) invocation.arguments().get(0), Integer.toString(width));
      editor.replaceExpression((Expression) invocation.arguments().get(1), Integer.toString(height));
      return true;
    }
    // not found
    return false;
View Full Code Here

  private boolean setSizeInts(int width, int height) throws Exception {
    MethodInvocation invocation = m_window.getMethodInvocation("setSize(int,int)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression((Expression) invocation.arguments().get(0), Integer.toString(width));
      editor.replaceExpression((Expression) invocation.arguments().get(1), Integer.toString(height));
      return true;
    }
    // not found
    return false;
  }
View Full Code Here

    MethodInvocation invocation =
        m_window.getMethodInvocation("setSize(java.lang.String,java.lang.String)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression(
          (Expression) invocation.arguments().get(0),
          "\"" + Integer.toString(width) + "px\"");
      editor.replaceExpression(
          (Expression) invocation.arguments().get(1),
          "\"" + Integer.toString(height) + "px\"");
      return true;
View Full Code Here

      AstEditor editor = m_window.getEditor();
      editor.replaceExpression(
          (Expression) invocation.arguments().get(0),
          "\"" + Integer.toString(width) + "px\"");
      editor.replaceExpression(
          (Expression) invocation.arguments().get(1),
          "\"" + Integer.toString(height) + "px\"");
      return true;
    }
    // not found
    return false;
View Full Code Here

  private boolean setWidthInt(int width) throws Exception {
    MethodInvocation invocation = m_window.getMethodInvocation("setWidth(int)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression((Expression) invocation.arguments().get(0), Integer.toString(width));
      return true;
    }
    // not found
    return false;
  }
View Full Code Here

  private boolean setWidthString(int width) throws Exception {
    MethodInvocation invocation = m_window.getMethodInvocation("setWidth(java.lang.String)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression(
          (Expression) invocation.arguments().get(0),
          "\"" + Integer.toString(width) + "px\"");
      return true;
    }
    // not found
    return false;
View Full Code Here

  private boolean setHeightInt(int height) throws Exception {
    MethodInvocation invocation = m_window.getMethodInvocation("setHeight(int)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression((Expression) invocation.arguments().get(0), Integer.toString(height));
      return true;
    }
    // not found
    return false;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.