Package org.eclipse.jdt.core.dom

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


  }

  @Override
  public boolean isJavaInfo(ASTNode node) {
    if (node instanceof MethodInvocation) {
      MethodInvocation invocation = (MethodInvocation) node;
      return invocation.arguments().isEmpty()
          && invocation.getName().getIdentifier().equals("getLayout")
          && m_container.isRepresentedBy(invocation.getExpression());
    }
    return false;
  }
View Full Code Here


   * Ensures that this {@link LayoutDataInfo} is materialized, i.e. has {@link ASTNode}.
   */
  VariableSupport materialize() throws Exception {
    String source = m_javaInfo.getDescription().getCreation(null).getSource();
    // prepare Container.add(component) invocation
    MethodInvocation invocation;
    {
      WidgetInfo component = (WidgetInfo) m_javaInfo.getParent();
      InvocationChildAssociation componentAssociation =
          (InvocationChildAssociation) component.getAssociation();
      invocation = componentAssociation.getInvocation();
      Assert.isTrue(
          invocation.arguments().size() == 1,
          "Invalid number of association arguments. %s for %s.",
          invocation,
          component);
    }
    // set CreationSupport
View Full Code Here

        // process supported association models...
        if (columnsList instanceof SimpleName) {
          // simple List variable
          bindColumnsAsList((SimpleName) columnsList, javaInfoList);
        } else if (columnsList instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) columnsList;
          IMethodBinding methodBinding = AstNodeUtils.getMethodBinding(invocation);
          if (methodBinding != null) {
            String methodQualifiedSignature =
                methodBinding.getDeclaringClass().getQualifiedName()
                    + "."
View Full Code Here

      throws Exception {
    // check ColumnConfig-s
    for (JavaInfo javaInfo : javaInfoList) {
      if (javaInfo instanceof ColumnConfigInfo && javaInfo.getParent() == null) {
        ColumnConfigInfo column = (ColumnConfigInfo) javaInfo;
        MethodInvocation invocation = getInvocationOfAssociationWithThisGrid(columnsList, column);
        if (invocation != null) {
          addChild(column);
          column.setAssociation(new ColumnConfigAssociation(columnsList, invocation));
        }
      }
View Full Code Here

   */
  private MethodInvocation getInvocationOfAssociationWithThisGrid(SimpleName columnsList,
      ColumnConfigInfo column) {
    for (ASTNode node : column.getRelatedNodes()) {
      if (node.getLocationInParent() == MethodInvocation.ARGUMENTS_PROPERTY) {
        MethodInvocation invocation = (MethodInvocation) node.getParent();
        if (invocation.getName().getIdentifier().equals("add")
            && isSameColumnsList(columnsList, invocation.getExpression())) {
          return invocation;
        }
      }
    }
    return null;
View Full Code Here

    }
    //
    AstEditor editor = getEditor();
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      MethodInvocation invocation = association.getInvocation();
      // set percent
      if (value.endsWith("%")) {
        ColumnLayoutDataInfo columnData;
        if (association.getDescription().getSignature().endsWith(",int)")) {
          columnData = setWidth_addColumnLayoutData(widget, invocation);
View Full Code Here

        ClassInstanceCreation columnModelCreation = getColumnModelCreation(true);
        // "columns" List usage in "ColumnModel" creation
        List<Expression> columnModelArguments = DomGenerics.arguments(columnModelCreation);
        Expression columnsList = columnModelArguments.get(0);
        if (columnsList instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) columnsList;
          if (invocation == arrayInfo.getInvocation()) {
            return;
          }
        }
        // if no columns then generate new Array.asList()
        MethodInvocation invocation =
            (MethodInvocation) getEditor().replaceExpression(
                columnsList,
                "java.util.Arrays.asList()");
        arrayInfo.setInvocation(invocation);
      }
View Full Code Here

        }
      }

      private boolean isButtonInvocation(ASTNode node) {
        if (node instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) node;
          return isRepresentedBy(invocation.getExpression());
        }
        return false;
      }
    });
  }
View Full Code Here

       * Rough approximation for association checking, may fail sometimes. But I think that GWT-Ext
       * deserve hardly better implementation.
       */
      private boolean isPossibleAssociation(ASTNode node) {
        if (node instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) node;
          for (Expression argument : DomGenerics.arguments(invocation)) {
            if (m_javaInfo.isRepresentedBy(argument)) {
              return true;
            }
          }
View Full Code Here

      /**
       * Rough approximation for association checking, may fail sometimes.
       */
      private boolean isPossibleAssociation(ASTNode node) {
        if (node instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) node;
          List<Expression> arguments = DomGenerics.arguments(invocation);
          return !arguments.isEmpty() && isRepresentedBy(arguments.get(0));
        }
        return false;
      }
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.