示例#1
0
  /**
   * @see com.alkacon.acacia.client.I_EntityRenderer#renderInline(com.alkacon.vie.shared.I_Entity,
   *     java.lang.String, com.google.gwt.dom.client.Element, int, int)
   */
  public void renderInline(
      I_Entity parentEntity,
      String attributeName,
      Element context,
      int minOccurrence,
      int maxOccurrence) {

    I_EntityAttribute attribute = parentEntity.getAttribute(attributeName);
    if (attribute != null) {
      if (attribute.isSimpleValue()) {
        List<Element> elements = m_vie.getAttributeElements(parentEntity, attributeName, context);
        for (int i = 0; i < elements.size(); i++) {
          Element element = elements.get(i);
          I_EditWidget widget =
              m_widgetService.getAttributeWidget(attributeName).initWidget(element, true);
          widget.addValueChangeHandler(new WidgetChangeHandler(parentEntity, attributeName, i));
        }
      } else {
        for (I_Entity entity : attribute.getComplexValues()) {
          renderInline(entity, context);
        }
      }
    }
  }