package com.celements.structEditor.fields;

import org.xwiki.component.annotation.Component;

@Component(OptionTagPageType.INPUT_FIELD_PAGETYPE_NAME)
public class OptionTagPageType extends AbstractStructFieldPageType {

  public static final String INPUT_FIELD_PAGETYPE_NAME = "OptionTag";

  static final String VIEW_TEMPLATE_NAME = "OptionTagView";

  @Override
  public String getName() {
    return INPUT_FIELD_PAGETYPE_NAME;
  }

  @Override
  protected String getViewTemplateName() {
    return VIEW_TEMPLATE_NAME;
  }

}

@@ -52,473 +52,2283 @@
 org.
-xwiki.component.annotation.Component;%0A%0A@Component(OptionTagPageType.INPUT_FIELD_PAGETYPE_NAME)%0Apublic class OptionTagPageType extends AbstractStructFieldPageType %7B%0A%0A  public static final String INPUT_FIELD_PAGETYPE_NAME = %22OptionTag%22;%0A%0A  static final String VIEW_TEMPLATE_NAME = %22OptionTagView%22;%0A%0A  @Override%0A  public String getName() %7B%0A    return INPUT_FIELD_PAGETYPE_NAME;%0A  %7D%0A%0A  @Override%0A  protected String getViewTemplateName() %7B%0A    return VIEW_TEMPLATE_NAME;
+slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.xwiki.component.annotation.Component;%0Aimport org.xwiki.component.annotation.Requirement;%0Aimport org.xwiki.model.reference.DocumentReference;%0A%0Aimport com.celements.cells.attribute.AttributeBuilder;%0Aimport com.celements.model.access.exception.DocumentNotExistsException;%0Aimport com.celements.model.context.ModelContext;%0Aimport com.celements.structEditor.classes.OptionTagEditorClass;%0Aimport com.celements.structEditor.classes.StructEditorClass;%0Aimport com.google.common.base.Optional;%0Aimport com.xpn.xwiki.objects.BaseObject;%0A%0A@Component(OptionTagPageType.INPUT_FIELD_PAGETYPE_NAME)%0Apublic class OptionTagPageType extends AbstractStructFieldPageType %7B%0A%0A  private static Logger LOGGER = LoggerFactory.getLogger(OptionTagPageType.class);%0A%0A  @Requirement(OptionTagEditorClass.CLASS_DEF_HINT)%0A  private StructEditorClass optionTagEditorClass;%0A%0A  @Requirement%0A  private ModelContext modelContext;%0A%0A  public static final String INPUT_FIELD_PAGETYPE_NAME = %22OptionTag%22;%0A%0A  static final String VIEW_TEMPLATE_NAME = %22OptionTagView%22;%0A%0A  @Override%0A  public String getName() %7B%0A    return INPUT_FIELD_PAGETYPE_NAME;%0A  %7D%0A%0A  @Override%0A  protected String getViewTemplateName() %7B%0A    return VIEW_TEMPLATE_NAME;%0A  %7D%0A%0A  @Override%0A  public Optional%3CString%3E defaultTagName() %7B%0A    return Optional.of(%22option%22);%0A  %7D%0A%0A  @Override%0A  public void collectAttributes(AttributeBuilder attrBuilder, DocumentReference cellDocRef) %7B%0A    BaseObject optionConfig;%0A    DocumentReference optionClassRef = optionTagEditorClass.getClassRef(%0A        cellDocRef.getWikiReference());%0A    try %7B%0A      optionConfig = modelAccess.getXObject(cellDocRef, optionClassRef);%0A%0A      if (optionConfig.getIntValue(%22option_tag_is_selected%22) == 1) %7B%0A        attrBuilder.addEmptyAttribute(%22selected%22);%0A      %7D%0A      if (optionConfig.getIntValue(%22option_tag_is_disabled%22) == 1) %7B%0A        attrBuilder.addEmptyAttribute(%22disabled%22);%0A      %7D%0A      attrBuilder.addNonEmptyAttribute(%22value%22, optionConfig.getStringValue(%22option_tag_value%22));%0A      attrBuilder.addNonEmptyAttribute(%22label%22, optionConfig.getStringValue(%22option_tag_label%22));%0A    %7D catch (DocumentNotExistsException exc) %7B%0A      LOGGER.error(%22Document %7B%7D or Document %7B%7D does not exist %7B%7D%22, optionClassRef, exc);%0A    %7D
 %0A  %7D

Add rendering for OptionTag