Package org.eclipse.jdt.core.dom

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


  }

  private void command_LOCATION_Y(WidgetInfo widget, int y) throws Exception {
    // TopHeight
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetTopHeight");
      if (invocation != null) {
        setInvocationArgument(invocation, 1, y, false);
        return;
      }
    }
    // BottomHeight
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetBottomHeight");
      if (invocation != null) {
        int bottom = getBounds().height - y - widget.getBounds().height;
        setInvocationArgument(invocation, 1, bottom, false);
        return;
      }
    }
    // TopBottom
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetTopBottom");
      if (invocation != null) {
        int bottom = getBounds().height - y - widget.getBounds().height;
        setInvocationArgument(invocation, 1, y, false);
        setInvocationArgument(invocation, 3, bottom, false);
        return;
View Full Code Here


  private void command_SIZE_X(WidgetInfo widget, int width, ResizeDirection direction)
      throws Exception {
    Rectangle bounds = widget.getBounds();
    // LeftWidth
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetLeftWidth");
      if (invocation != null) {
        if (direction == ResizeDirection.LEADING) {
          int oldLeft = bounds.left();
          int deltaWidth = width - bounds.width;
          int left = oldLeft - deltaWidth;
          setInvocationArgument(invocation, 1, left, true);
        }
        setInvocationArgument(invocation, 3, width, true);
        return;
      }
    }
    // RightWidth
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetRightWidth");
      if (invocation != null) {
        if (direction == ResizeDirection.TRAILING) {
          int oldRight = getBounds().width - bounds.right();
          int deltaWidth = width - bounds.width;
          int right = oldRight - deltaWidth;
          setInvocationArgument(invocation, 1, right, true);
        }
        setInvocationArgument(invocation, 3, width, true);
        return;
      }
    }
    // LeftRight
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetLeftRight");
      if (invocation != null) {
        if (direction == ResizeDirection.LEADING) {
          int oldLeft = bounds.left();
          int deltaWidth = width - bounds.width;
          int left = oldLeft - deltaWidth;
View Full Code Here

  private void command_SIZE_Y(WidgetInfo widget, int height, ResizeDirection direction)
      throws Exception {
    Rectangle bounds = widget.getBounds();
    // TopHeight
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetTopHeight");
      if (invocation != null) {
        if (direction == ResizeDirection.LEADING) {
          int oldTop = bounds.top();
          int deltaHeight = height - bounds.height;
          int top = oldTop - deltaHeight;
          setInvocationArgument(invocation, 1, top, false);
        }
        setInvocationArgument(invocation, 3, height, false);
        return;
      }
    }
    // BottomHeight
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetBottomHeight");
      if (invocation != null) {
        if (direction == ResizeDirection.TRAILING) {
          int oldBottom = getBounds().height - bounds.bottom();
          int deltaHeight = height - bounds.height;
          int bottom = oldBottom - deltaHeight;
          setInvocationArgument(invocation, 1, bottom, false);
        }
        setInvocationArgument(invocation, 3, height, false);
        return;
      }
    }
    // TopBottom
    {
      MethodInvocation invocation = getWidgetInvocation(widget, "setWidgetTopBottom");
      if (invocation != null) {
        if (direction == ResizeDirection.LEADING) {
          int oldTop = bounds.top();
          int deltaHeight = height - bounds.height;
          int top = oldTop - deltaHeight;
View Full Code Here

    }
    getBroadcast(ObjectInfoDeactivePropertyEditor.class).invoke();
  }

  private void command_ANCHOR_horizontal(WidgetInfo widget, Anchor anchor) throws Exception {
    MethodInvocation invocation;
    Rectangle bounds = widget.getBounds();
    AstEditor editor = getEditor();
    if ((invocation = getWidgetInvocation(widget, "setWidgetLeftWidth")) != null) {
      if (anchor == Anchor.NONE) {
        editor.removeEnclosingStatement(invocation);
View Full Code Here

      }
    }
  }

  private void command_ANCHOR_vertical(WidgetInfo widget, Anchor anchor) throws Exception {
    MethodInvocation invocation;
    Rectangle bounds = widget.getBounds();
    AstEditor editor = getEditor();
    if ((invocation = getWidgetInvocation(widget, "setWidgetTopHeight")) != null) {
      int bottom = getBounds().height - bounds.bottom();
      if (anchor == Anchor.NONE) {
View Full Code Here

  /**
   * Parse given expression and if it is valid GWT NLS expression, extract required information.
   */
  private static ExpressionInfo getExpressionInfo(JavaInfo component, Expression expression) {
    if (expression instanceof MethodInvocation) {
      MethodInvocation invocation = (MethodInvocation) expression;
      // check invocation
      if (invocation.arguments().size() != 0) {
        return null;
      }
      if (!(invocation.getExpression() instanceof SimpleName)) {
        return null;
      }
      //
      SimpleName field = (SimpleName) invocation.getExpression();
      String bundleName = AstNodeUtils.getFullyQualifiedName(field, true);
      String fieldName = field.getIdentifier();
      //
      SimpleName keyExpression = invocation.getName();
      String key = keyExpression.getIdentifier();
      //
      ExpressionInfo expressionInfo =
          new ExpressionInfo(expression, bundleName, fieldName, keyExpression, key);
      expression.setProperty(NLS_EXPRESSION_INFO, expressionInfo);
View Full Code Here

   * @return <code>true</code> if given {@link Expression} represents this
   *         {@link ImageBundlePrototypeDescription}.
   */
  public boolean isRepresentedBy(Expression expression) {
    if (expression instanceof MethodInvocation) {
      MethodInvocation invocation = (MethodInvocation) expression;
      return AstNodeUtils.isMethodInvocation(
          invocation,
          m_bundle.getDescription().getComponentClass().getName(),
          m_methodSignature);
    }
View Full Code Here

  }

  private Dimension getSize() throws Exception {
    // check for forced size
    {
      MethodInvocation invocation = m_rootPanel.getMethodInvocation("setPixelSize(int,int)");
      if (invocation != null) {
        List<Expression> arguments = DomGenerics.arguments(invocation);
        int width = (Integer) JavaInfoEvaluationHelper.getValue(arguments.get(0));
        int height = (Integer) JavaInfoEvaluationHelper.getValue(arguments.get(1));
        return new Dimension(width, height);
View Full Code Here

  private void createHeaderProperty() {
    Association association = getAssociation();
    if (association instanceof InvocationChildAssociation) {
      InvocationChildAssociation invocationAssociation = (InvocationChildAssociation) association;
      MethodInvocation associationInvocation = invocationAssociation.getInvocation();
      // check for supported association invocations
      boolean supportedAssociation = false;
      String signature = AstNodeUtils.getMethodSignature(associationInvocation);
      for (String supportedSignature : HEADER_SIG_PREFIXES) {
        if (signature.startsWith(supportedSignature)) {
View Full Code Here

      return null;
    }

    private Expression getExpression() {
      InvocationChildAssociation association = (InvocationChildAssociation) getAssociation();
      MethodInvocation invocation = association.getInvocation();
      List<Expression> arguments = DomGenerics.arguments(invocation);
      // no header argument
      if (arguments.size() < 2) {
        return 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.