Package org.eclipse.jdt.core.dom

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


        }
      }

      private void createChildSlider(JavaInfo child) throws Exception {
        // prepare "null" expression to replace with Slider
        Expression sliderExpression;
        {
          ClassInstanceCreation fieldCreation =
              ((ConstructorCreationSupport) child.getCreationSupport()).getCreation();
          sliderExpression = DomGenerics.arguments(fieldCreation).get(0);
        }
View Full Code Here


    setColumnWidth_sort();
  }

  private void setColumnWidth_setIndex(ValueObject_setColumnWidth object, int index)
      throws Exception {
    Expression e = getEditor().replaceExpression(object.m_indexExpression, "" + index);
    JavaInfoEvaluationHelper.setValue(e, index);
  }
View Full Code Here

  private List<ValueObject_setColumnWidth> setColumnWidth_getInvocationObjects() throws Exception {
    String signature = "setColumnWidth(int,double)";
    List<ValueObject_setColumnWidth> objects = Lists.newArrayList();
    for (MethodInvocation invocation : getMethodInvocations(signature)) {
      List<Expression> arguments = DomGenerics.arguments(invocation);
      Expression indexExpression = arguments.get(0);
      Expression valueExpression = arguments.get(1);
      Object indexValue = JavaInfoEvaluationHelper.getValue(indexExpression);
      if (indexValue instanceof Integer) {
        int index = ((Integer) indexValue).intValue();
        objects.add(new ValueObject_setColumnWidth(index,
            invocation,
View Full Code Here

  /**
   * @return the index of column to which given {@link PortletInfo} belongs, may be <code>-1</code>
   *         .
   */
  private static int getColumnIndex(PortletInfo portlet) {
    Expression columnExpression = getColumnIndexExpression(portlet);
    if (columnExpression != null) {
      Object columnValue = JavaInfoEvaluationHelper.getValue(columnExpression);
      if (columnValue instanceof Integer) {
        return ((Integer) columnValue).intValue();
      }
View Full Code Here

  /**
   * Sets the index of column to which given {@link PortletInfo} belongs.
   */
  private static void setColumnIndex(PortletInfo portlet, int column) throws Exception {
    Expression columnExpression = getColumnIndexExpression(portlet);
    if (columnExpression != null) {
      Expression e = portlet.getEditor().replaceExpression(columnExpression, "" + column);
      JavaInfoEvaluationHelper.setValue(e, column);
    }
  }
View Full Code Here

   *         <code>null</code>.
   */
  private MethodInvocation getInvocation(ComponentInfo component, EventDescription description) {
    List<MethodInvocation> invocations = component.getMethodInvocations(ADD_LISTENER_SIGNATURE);
    for (MethodInvocation invocation : invocations) {
      Expression nameExpression = DomGenerics.arguments(invocation).get(0);
      if (nameExpression.toString().endsWith(description.getName())) {
        return invocation;
      }
    }
    return null;
  }
View Full Code Here

            "}");
    frame.refresh();
    assertNoErrors(frame);
    // prepare Expression's
    List<WidgetInfo> images = frame.getChildrenWidgets();
    Expression firstExpression =
        ((MethodInvocation) images.get(0).getCreationSupport().getNode()).getExpression();
    Expression secondExpression =
        ((MethodInvocation) images.get(1).getCreationSupport().getNode()).getExpression();
    // prepare prototypes
    List<ImageBundlePrototypeDescription> prototypes;
    {
      ImageBundleInfo bundle = ImageBundleContainerInfo.getBundles(frame).get(0);
View Full Code Here

    int dims = at.getDimensions();
    Type elementType = at.getElementType();
    elementType.accept(this);
    for (Iterator it = node.dimensions().iterator(); it.hasNext(); ) {
      this.buffer.append("[");//$NON-NLS-1$
      Expression e = (Expression) it.next();
      e.accept(this);
      this.buffer.append("]");//$NON-NLS-1$
      dims--;
    }
    // add empty "[]" for each extra array dimension
    for (int i= 0; i < dims; i++) {
View Full Code Here

   * @see ASTVisitor#visit(ArrayInitializer)
   */
  public boolean visit(ArrayInitializer node) {
    this.buffer.append("{");//$NON-NLS-1$
    for (Iterator it = node.expressions().iterator(); it.hasNext(); ) {
      Expression e = (Expression) it.next();
      e.accept(this);
      if (it.hasNext()) {
        this.buffer.append(",");//$NON-NLS-1$
      }
    }
    this.buffer.append("}");//$NON-NLS-1$
View Full Code Here

      }
      node.getType().accept(this);
    }
    this.buffer.append("(");//$NON-NLS-1$
    for (Iterator it = node.arguments().iterator(); it.hasNext(); ) {
      Expression e = (Expression) it.next();
      e.accept(this);
      if (it.hasNext()) {
        this.buffer.append(",");//$NON-NLS-1$
      }
    }
    this.buffer.append(")");//$NON-NLS-1$
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.