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

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


  /**
   * @return the {@link Expression} of size argument of association. May be <code>null</code>.
   */
  private Expression getSizeExpression(WidgetInfo widget) {
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      MethodInvocation invocation = association.getInvocation();
      List<Expression> arguments = DomGenerics.arguments(invocation);
      if (arguments.size() == 2) {
        return arguments.get(1);
      }
    }
View Full Code Here


   * When we add new {@link WidgetInfo} child, we know that <code>new HTML()</code> is used as
   * header. So, we should add model for this <code>HTML</code> as child of added {@link WidgetInfo}
   * .
   */
  private void addModelHTML(WidgetInfo component) throws Exception {
    InvocationChildAssociation association =
        (InvocationChildAssociation) component.getAssociation();
    MethodInvocation invocation = association.getInvocation();
    ClassInstanceCreation headerExpression =
        (ClassInstanceCreation) DomGenerics.arguments(invocation).get(1);
    WidgetInfo header =
        (WidgetInfo) JavaInfoUtils.createJavaInfo(
            getEditor(),
View Full Code Here

  /**
   * Sets integer argument of {@link WidgetInfo} association with {@link HTMLTableInfo}.
   */
  void setAssociationArgumentInt(String tagName, int y) throws Exception {
    if (m_component.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association =
          (InvocationChildAssociation) m_component.getAssociation();
      MethodInvocation invocation = association.getInvocation();
      for (ParameterDescription parameter : association.getDescription().getParameters()) {
        if (parameter.getTags().containsKey(tagName)) {
          List<Expression> arguments = DomGenerics.arguments(invocation);
          Expression argument = arguments.get(parameter.getIndex());
          m_panel.setIntExpression(argument, y);
        }
View Full Code Here

  /**
   * @return the name of method used to associate given {@link WidgetInfo}, may be <code>null</code>
   *         .
   */
  private static String getWidgetAssociationMethod(WidgetInfo widget) {
    InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
    return association.getDescription().getName();
  }
View Full Code Here

  }

  private void command_REGION(WidgetInfo widget, String region) throws Exception {
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      String methodName = getRegionMethod(region);
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      MethodInvocation invocation = association.getInvocation();
      getEditor().replaceInvocationName(invocation, methodName);
    }
  }
View Full Code Here

   * Ensures that this {@link LayoutDataInfo} has {@link LocalUniqueVariableSupport}.
   */
  VariableSupport materialize() throws Exception {
    WidgetInfo widget = (WidgetInfo) m_javaInfo.getParent();
    // prepare add() invocation
    InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
    MethodInvocation invocation = association.getInvocation();
    // ensure LayoutData expression
    Expression expression;
    {
      List<Expression> arguments = DomGenerics.arguments(invocation);
      String source = m_javaInfo.getDescription().getCreation(null).getSource();
View Full Code Here

    if (JavaInfoUtils.isIndirectlyExposed(widget)) {
      return false;
    }
    // right now support only "add()" method
    if (widget.getAssociation() instanceof InvocationChildAssociation) {
      InvocationChildAssociation association = (InvocationChildAssociation) widget.getAssociation();
      if (association.getDescription().getName().equals("add")) {
        return true;
      }
      return false;
    }
    // may be exposed
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.