Package org.eclipse.wb.core.model.association

Examples of org.eclipse.wb.core.model.association.InvocationChildAssociation


        return (int) (weight * 100) + "%";
      }
    }
    // 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


    String source = m_javaInfo.getDescription().getCreation(null).getSource();
    // prepare Container.add(component) invocation
    MethodInvocation invocation;
    {
      WidgetInfo component = (WidgetInfo) m_javaInfo.getParent();
      InvocationChildAssociation componentAssociation =
          (InvocationChildAssociation) component.getAssociation();
      invocation = componentAssociation.getInvocation();
      Assert.isTrue(
          invocation.arguments().size() == 1,
          "Invalid number of association arguments. %s for %s.",
          invocation,
          component);
View Full Code Here

      value = "100";
    }
    //
    AstEditor editor = getEditor();
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      MethodInvocation invocation = association.getInvocation();
      // set percent
      if (value.endsWith("%")) {
        ColumnLayoutDataInfo columnData;
        if (association.getDescription().getSignature().endsWith(",int)")) {
          columnData = setWidth_addColumnLayoutData(widget, invocation);
        } else {
          columnData = widget.getChildren(ColumnLayoutDataInfo.class).get(0);
        }
        // set "columnWidth" property
View Full Code Here

  public List<ButtonInfo> getButtonBarButtons() {
    List<ButtonInfo> barButtons = Lists.newArrayList();
    List<ButtonInfo> allButtons = getChildren(ButtonInfo.class);
    for (ButtonInfo button : allButtons) {
      if (button.getAssociation() instanceof InvocationChildAssociation) {
        InvocationChildAssociation association =
            (InvocationChildAssociation) button.getAssociation();
        if (association.getDescription().getSignature().equals(
            "addButton(com.extjs.gxt.ui.client.widget.button.Button)")) {
          barButtons.add(button);
        }
      }
    }
View Full Code Here

   * @return the {@link Expression} of column index to which given {@link PortletInfo} belongs, may
   *         be <code>null</code>.
   */
  private static Expression getColumnIndexExpression(PortletInfo portlet) {
    if (portlet.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association =
          (InvocationChildAssociation) portlet.getAssociation();
      if (association.getDescription().getSignature().equals(
          "add(com.extjs.gxt.ui.client.widget.custom.Portlet,int)")) {
        MethodInvocation invocation = association.getInvocation();
        return DomGenerics.arguments(invocation).get(1);
      }
    }
    return null;
  }
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

      // not String value
      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

    /**
     * @return the association {@link MethodInvocation}.
     */
    private MethodInvocation getInvocation() {
      InvocationChildAssociation association = (InvocationChildAssociation) getAssociation();
      return association.getInvocation();
    }
View Full Code Here

  // Edge
  //
  ////////////////////////////////////////////////////////////////////////////
  public String getEdge(WidgetInfo widget) {
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      String methodName = association.getInvocation().getName().getIdentifier();
      String edge = StringUtils.removeStart(methodName, "add");
      if (edge.length() == 0) {
        return "CENTER";
      }
      return edge.toUpperCase(Locale.ENGLISH);
View Full Code Here

    return edge.equals("NORTH") || edge.equals("SOUTH");
  }

  public void setEdge(WidgetInfo widget, String edge) throws Exception {
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      MethodInvocation invocation = association.getInvocation();
      // add/remove "size" argument
      String oldMethodName = invocation.getName().getIdentifier();
      if (!edge.equals("CENTER") && oldMethodName.equals("add")) {
        getEditor().addInvocationArgument(invocation, 1, "1.0");
        setReasonableSize(widget);
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.model.association.InvocationChildAssociation

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.