Examples of replaceExpression()


Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

        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

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

    // 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);
      columnData.addRelatedNode(expression);
    }
    // set Association
    columnData.setAssociation(new InvocationSecondaryAssociation(invocation));
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

        {
          ClassInstanceCreation creation =
              ((ConstructorCreationSupport) getCreationSupport()).getCreation();
          expression = DomGenerics.arguments(creation).get(0);
          String contentSource = content.getCreationSupport().add_getSource(null);
          expression = editor.replaceExpression(expression, contentSource);
          content.getCreationSupport().add_setSourceExpression(expression);
          content.addRelatedNode(expression);
        }
        // set Association
        content.setAssociation(new ConstructorChildAssociation());
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

          });
        } else {
          // replace argument
          ExecutionUtils.run(m_this, new RunnableEx() {
            public void run() throws Exception {
              editor.replaceExpression(arguments.get(1), valueSource);
              // may be was not String argument
              editor.replaceInvocationBinding(invocation);
            }
          });
        }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

        String signature = signaturePrefix + "java.lang.String)";
        if (AstNodeUtils.isMethodInvocation(invocation, signature)) {
          final String valueSource = StringConverter.INSTANCE.toJavaSource(m_this, valueString);
          ExecutionUtils.run(m_this, new RunnableEx() {
            public void run() throws Exception {
              editor.replaceExpression(arguments.get(1), valueSource);
            }
          });
        }
      }
      // setColumnWidth(Column,double,Unit)
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

          // apply "value" and "unit"
          final String valueSource = DoubleConverter.INSTANCE.toJavaSource(m_this, sizeValue);
          final String unitSource = typeNameUnit + "." + sizeUnit.toString();
          ExecutionUtils.run(m_this, new RunnableEx() {
            public void run() throws Exception {
              editor.replaceExpression(arguments.get(1), valueSource);
              editor.replaceExpression(arguments.get(2), unitSource);
            }
          });
        }
      }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

          final String valueSource = DoubleConverter.INSTANCE.toJavaSource(m_this, sizeValue);
          final String unitSource = typeNameUnit + "." + sizeUnit.toString();
          ExecutionUtils.run(m_this, new RunnableEx() {
            public void run() throws Exception {
              editor.replaceExpression(arguments.get(1), valueSource);
              editor.replaceExpression(arguments.get(2), unitSource);
            }
          });
        }
      }
    }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

      final Expression expression = getExpression(javaInfo);
      if (expression != null) {
        if (source != null) {
          ExecutionUtils.run(javaInfo, new RunnableEx() {
            public void run() throws Exception {
              editor.replaceExpression(expression, source);
            }
          });
        } else {
          ExecutionUtils.run(javaInfo, new RunnableEx() {
            public void run() throws Exception {
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

      final Expression expression = getExpression(javaInfo);
      if (expression != null) {
        if (source != null) {
          ExecutionUtils.run(javaInfo, new RunnableEx() {
            public void run() throws Exception {
              editor.replaceExpression(expression, source);
            }
          });
        } else {
          ExecutionUtils.run(javaInfo, new RunnableEx() {
            public void run() throws Exception {
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.AstEditor.replaceExpression()

  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
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.