Package org.eclipse.wb.internal.core.utils.ast

Examples of org.eclipse.wb.internal.core.utils.ast.StatementTarget


        SimpleName columnsList = ensureColumnsList();
        ColumnConfigAssociation association = new ColumnConfigAssociation(columnsList);
        AssociationObject associationObject = new AssociationObject(association, true);
        if (nextColumn == null) {
          Statement columnsListUsageStatement = AstNodeUtils.getEnclosingStatement(columnsList);
          StatementTarget target = new StatementTarget(columnsListUsageStatement, true);
          JavaInfoUtils.addTarget(column, associationObject, GridInfo.this, target);
        } else {
          JavaInfoUtils.add(column, associationObject, GridInfo.this, nextColumn);
        }
      }

      @Override
      void move(ColumnConfigInfo column, ColumnConfigInfo nextColumn) throws Exception {
        SimpleName columnsList = ensureColumnsList();
        ColumnConfigAssociation association = new ColumnConfigAssociation(columnsList);
        AssociationObject associationObject = new AssociationObject(association, true);
        if (nextColumn == null) {
          Statement columnsListUsageStatement = AstNodeUtils.getEnclosingStatement(columnsList);
          StatementTarget target = new StatementTarget(columnsListUsageStatement, true);
          JavaInfoUtils.moveTarget(column, associationObject, GridInfo.this, null, target);
        } else {
          JavaInfoUtils.move(column, associationObject, GridInfo.this, nextColumn);
        }
      }

      SimpleName ensureColumnsList() throws Exception {
        ClassInstanceCreation columnModelCreation = getColumnModelCreation(true);
        // "columns" List usage in "ColumnModel" creation
        List<Expression> columnModelArguments = DomGenerics.arguments(columnModelCreation);
        Expression columnsList = columnModelArguments.get(0);
        if (columnsList instanceof SimpleName) {
          return (SimpleName) columnsList;
        }
        // if no columns then generate new ArrayList
        Statement columnModelStatement = AstNodeUtils.getEnclosingStatement(columnModelCreation);
        StatementTarget target = new StatementTarget(columnModelStatement, true);
        String configsName =
            getEditor().getUniqueVariableName(
                columnModelStatement.getStartPosition(),
                "configs",
                null);
View Full Code Here


  @Override
  protected StatementTarget getMethodInvocationTarget(String newSignature) throws Exception {
    if (getCreationSupport() instanceof ThisCreationSupport) {
      ThisCreationSupport creationSupport = (ThisCreationSupport) getCreationSupport();
      MethodDeclaration constructor = creationSupport.getConstructor();
      return new StatementTarget(constructor, false);
    }
    return super.getMethodInvocationTarget(newSignature);
  }
View Full Code Here

  @Override
  public void add(JavaInfo child, StatementTarget target, Association association) throws Exception {
    // prepare block
    Block block = (Block) child.getEditor().addStatement(ImmutableList.of("{", "}"), target);
    // add statements in block
    target = new StatementTarget(block, true);
    add(child, target, null, association);
  }
View Full Code Here

                "com.extjs.gxt.ui.client.widget.Slider",
                new ConstructorCreationSupport());
        // prepare "new Slider()" source
        String sliderSource;
        {
          StatementTarget statementTarget =
              new StatementTarget(AstNodeUtils.getEnclosingStatement(sliderExpression), true);
          NodeTarget nodeTarget = new NodeTarget(statementTarget);
          sliderSource = slider.getCreationSupport().add_getSource(nodeTarget);
        }
        // replace "null" with "new Slider()"
        sliderExpression = getEditor().replaceExpression(sliderExpression, sliderSource);
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  public void command_CREATE(WidgetInfo item, WidgetInfo nextItem) throws Exception {
    AssociationObject associationObject =
        AssociationObjects.invocationChild("%parent%.setField(%child%)", true);
    StatementTarget target = getTargetForNewItem(item, nextItem);
    JavaInfoUtils.addTarget(item, associationObject, this, target);
  }
View Full Code Here

    JavaInfoUtils.addTarget(item, associationObject, this, target);
  }

  private StatementTarget getTargetForNewItem(WidgetInfo item, WidgetInfo nextItem)
      throws Exception {
    StatementTarget target;
    if (nextItem == null) {
      Statement thisAssociationStatement = getAssociation().getStatement();
      target = new StatementTarget(thisAssociationStatement, true);
    } else {
      target = JavaInfoUtils.getTarget(this, item, nextItem);
    }
    return target;
  }
View Full Code Here

      public int compare(ValueObject_setColumnWidth o1, ValueObject_setColumnWidth o2) {
        return o1.m_index - o2.m_index;
      }
    });
    // move invocations
    StatementTarget target = getMethodInvocationTarget(signature);
    for (ValueObject_setColumnWidth object : objects) {
      MethodInvocation invocation = object.m_invocation;
      Statement statement = AstNodeUtils.getEnclosingStatement(invocation);
      getEditor().moveStatement(statement, target);
      target = new StatementTarget(statement, false);
    }
  }
View Full Code Here

              this,
              widget,
              SIZE_FORMAT.format(x),
              "com.google.gwt.dom.client.Style.Unit.PX",
              SIZE_FORMAT.format(defaultWidth));
      StatementTarget target = getNewConstraintsTarget(widget);
      Expression expression = widget.addExpressionStatement(target, source);
      addRelatedNodes(expression);
    }
  }
View Full Code Here

              this,
              widget,
              SIZE_FORMAT.format(y),
              "com.google.gwt.dom.client.Style.Unit.PX",
              SIZE_FORMAT.format(defaultHeight));
      StatementTarget target = getNewConstraintsTarget(widget);
      Expression expression = widget.addExpressionStatement(target, source);
      addRelatedNodes(expression);
    }
  }
View Full Code Here

              this,
              widget,
              SIZE_FORMAT.format(0.0),
              "com.google.gwt.dom.client.Style.Unit.PX",
              SIZE_FORMAT.format(width));
      StatementTarget target = getNewConstraintsTarget(widget);
      Expression expression = widget.addExpressionStatement(target, source);
      addRelatedNodes(expression);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.utils.ast.StatementTarget

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.