Package org.eclipse.jdt.core.dom

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


                  rowTypeName);
          String line2 =
              TemplateUtils.format("\tpublic int compare({0} o1, {0} o2) '{'", rowTypeName);
          List<String> lines = ImmutableList.of(line1, line2, "\t\treturn 0;", "\t}", "})");
          String source = Joiner.on("\n").join(lines);
          MethodInvocation invocation = (MethodInvocation) addExpressionStatement(target, source);
          result.set(invocation);
        }
      });
      return result.get();
    }
View Full Code Here


     */
    private boolean isListHandlerForThisTable(VariableDeclaration variable) {
      String listHandlerName = variable.getName().getIdentifier();
      String signature =
          "addColumnSortHandler(com.google.gwt.user.cellview.client.ColumnSortEvent.Handler)";
      MethodInvocation invocation = getParentJava().getMethodInvocation(signature);
      Expression listHandlerArgument = DomGenerics.arguments(invocation).get(0);
      return listHandlerArgument.toString().equals(listHandlerName);
    }
View Full Code Here

        }
      }

      private boolean isPossibleAssociation(ASTNode node) {
        if (node instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) node;
          for (Expression argument : DomGenerics.arguments(invocation)) {
            if (isRepresentedBy(argument)) {
              return true;
            }
          }
View Full Code Here

   * .
   */
  private void addModelHTML(WidgetInfo component) throws Exception {
    InvocationChildAssociation association =
        (InvocationChildAssociation) component.getAssociation();
    MethodInvocation invocation = association.getInvocation();
    ClassInstanceCreation headerExpression =
        (ClassInstanceCreation) DomGenerics.arguments(invocation).get(1);
    WidgetInfo header =
        (WidgetInfo) JavaInfoUtils.createJavaInfo(
            getEditor(),
View Full Code Here

      Expression expression = m_property.getExpression();
      if (AstNodeUtils.isMethodInvocation(
          expression,
          "com.google.gwt.user.client.ui.AbstractImagePrototype",
          "createImage()")) {
        MethodInvocation createImageInvocation = (MethodInvocation) expression;
        Expression prototypeExpression = createImageInvocation.getExpression();
        JavaInfo rootJava = m_property.getJavaInfo().getRootJava();
        for (ImageBundleInfo bundle : ImageBundleContainerInfo.getBundles(rootJava)) {
          for (ImageBundlePrototypeDescription prototype : bundle.getPrototypes()) {
            if (prototype.isRepresentedBy(prototypeExpression)) {
              return prototype;
View Full Code Here

            editor,
            "com.google.gwt.user.client.ui.TreeItem",
            creationSupport);
    JavaInfoUtils.add(item, null, host, null);
    // prepare added invocation
    MethodInvocation invocation = (MethodInvocation) item.getCreationSupport().getNode();
    item.setAssociation(new InvocationVoidAssociation(invocation));
    // configure Widget
    {
      NodeTarget target = new NodeTarget(new StatementTarget(invocation, true));
      Expression widgetExpression =
View Full Code Here

   * @return <code>true</code> if this {@link FlexTableInfo} already "fixed".
   */
  private boolean hasInvocation_fixRowSpan() {
    for (ASTNode relatedNode : getRelatedNodes()) {
      if (relatedNode.getLocationInParent() == MethodInvocation.ARGUMENTS_PROPERTY) {
        MethodInvocation invocation = (MethodInvocation) relatedNode.getParent();
        if (invocation.toString().contains("FlexTableHelper.fixRowSpan(")) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

      // clear target cells
      removeCellInvocations(new Rectangle(column + 1, row, newSpan - 1, height));
      // add setColSpan() invocation
      {
        String arguments = String.format("%d, %d, %d", row, cell, newSpan);
        MethodInvocation invocation =
            m_flexCellFormatter.addMethodInvocation("setColSpan(int,int,int)", arguments);
        setIntExpression(DomGenerics.arguments(invocation).get(0), row);
        setIntExpression(DomGenerics.arguments(invocation).get(1), cell);
      }
    }
View Full Code Here

          Point location = getLocation(javaInfo);
          String argumentsSource =
              TemplateUtils.format("{0}, {1}, {2}", location.y, location.x, source);
          // add invocation
          JavaInfo formatter = getFormatter(javaInfo);
          MethodInvocation invocation =
              formatter.addMethodInvocation(target, m_methodSignature, argumentsSource);
          // remember values because they will be asked later because of
          // GenericPropertyImpl.rememberValueIntoExpression(Object)
          // TODO ask Mitin and may be remove "remember"
          {
View Full Code Here

        ClassInstanceCreation primitiveTypeCreation = findPrimitiveTypeCreation(getASTNode(workingUnit,
                bug.getPrimarySourceLineAnnotation()));
        if (primitiveTypeCreation == null) {
            throw new BugResolutionException("Primitive type creation not found.");
        }
        MethodInvocation valueOfInvocation = createValueOfInvocation(rewrite, workingUnit, primitiveTypeCreation);
        rewrite.replace(primitiveTypeCreation, valueOfInvocation, null);
    }
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.