Package org.eclipse.jdt.core.dom

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


          "Invalid number of association arguments. %s for %s.",
          invocation,
          component);
    }
    // set CreationSupport
    Expression expression;
    {
      expression = m_javaInfo.getEditor().addInvocationArgument(invocation, 1, source);
      m_javaInfo.setCreationSupport(new ConstructorCreationSupport((ClassInstanceCreation) expression));
      m_javaInfo.bindToExpression(expression);
      m_javaInfo.addRelatedNode(expression);
View Full Code Here


    ClassInstanceCreation columnModelCreation = getColumnModelCreation(false);
    if (columnModelCreation != null) {
      // exists ColumnModel creation
      List<Expression> columnModelArguments = DomGenerics.arguments(columnModelCreation);
      if (columnModelArguments.size() == 1) {
        Expression columnsList = columnModelArguments.get(0);
        // process supported association models...
        if (columnsList instanceof SimpleName) {
          // simple List variable
          bindColumnsAsList((SimpleName) columnsList, javaInfoList);
        } else if (columnsList instanceof MethodInvocation) {
View Full Code Here

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

    }
    // integer width expected
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      if (association.getDescription().getSignature().endsWith(",int)")) {
        Expression expression = DomGenerics.arguments(association.getInvocation()).get(1);
        return ((Integer) JavaInfoEvaluationHelper.getValue(expression)).toString();
      }
    }
    // impossible
    return Property.UNKNOWN_VALUE;
View Full Code Here

      void ensureColumnsAsArray() 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 MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) columnsList;
          if (invocation == arrayInfo.getInvocation()) {
            return;
          }
View Full Code Here

        // done
        return;
      }
      // set absolute value
      {
        Expression expression = DomGenerics.arguments(invocation).get(1);
        editor.replaceExpression(expression, value);
        editor.replaceInvocationBinding(invocation);
        for (JavaInfo columnData : widget.getChildren(ColumnLayoutDataInfo.class)) {
          columnData.delete();
        }
View Full Code Here

        (ColumnLayoutDataInfo) JavaInfoUtils.createJavaInfo(
            editor,
            "com.gwtext.client.widgets.layout.ColumnLayoutData",
            new ConstructorCreationSupport());
    // set CreationSupport
    Expression expression;
    {
      expression = DomGenerics.arguments(invocation).get(1);
      String contentSource = columnData.getCreationSupport().add_getSource(null);
      expression = editor.replaceExpression(expression, contentSource);
      columnData.getCreationSupport().add_setSourceExpression(expression);
View Full Code Here

            JavaInfoUtils.createJavaInfo(
                editor,
                "com.gwtext.client.widgets.Panel",
                new ConstructorCreationSupport());
        // set CreationSupport
        Expression expression;
        {
          ClassInstanceCreation creation =
              ((ConstructorCreationSupport) getCreationSupport()).getCreation();
          expression = DomGenerics.arguments(creation).get(0);
          String contentSource = content.getCreationSupport().add_getSource(null);
View Full Code Here

      @Override
      public void bindComponents(List<JavaInfo> components) throws Exception {
        String signature_setEl = "setEl(com.google.gwt.user.client.Element)";
        for (MethodInvocation invocation : getMethodInvocations(signature_setEl)) {
          List<Expression> arguments = DomGenerics.arguments(invocation);
          Expression elementExpression = arguments.get(0);
          if (AstNodeUtils.isMethodInvocation(elementExpression, "getElement()")) {
            Expression widgetExpression = ((MethodInvocation) elementExpression).getExpression();
            for (JavaInfo component : components) {
              if (component.isRepresentedBy(widgetExpression)) {
                addChild(component);
                component.setAssociation(new EmptyAssociation());
              }
View Full Code Here

  public Object getAnchor() throws Exception {
    if (getCreationSupport() instanceof ConstructorCreationSupport) {
      ConstructorCreationSupport creationSupport =
          (ConstructorCreationSupport) getCreationSupport();
      ClassInstanceCreation creation = creationSupport.getCreation();
      Expression anchorExpression = DomGenerics.arguments(creation).get(0);
      return JavaInfoEvaluationHelper.getValue(anchorExpression);
    }
    return Property.UNKNOWN_VALUE;
  }
View Full Code Here

TOP

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

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.