@PostConstruct
  public void init() {
    initWidget(uiBinder.createAndBindUi(this));

    accordion.setId(DOM.createUniqueId());
    formAccordionHeader.setDataParent(accordion.getId());
    formAccordionHeader.setDataTargetWidget(formAccordionCollapse);
    resultAccordionHeader.setDataParent(accordion.getId());
    resultAccordionHeader.setDataTargetWidget(resultAccordionCollapse);

    // TODO {porcelli} due a bug on bootstrap we can't use custom date formats
    createdAfter.setFormat(ApplicationPreferences.getDroolsDateFormat());
    createdBefore.setFormat(ApplicationPreferences.getDroolsDateFormat());
    lastModifiedAfter.setFormat(ApplicationPreferences.getDroolsDateFormat());
    lastModifiedBefore.setFormat(ApplicationPreferences.getDroolsDateFormat());

    formGroup.setStyleName(null);

    formatTypeahead.setDatasets(
        new StringDataset(
            new ArrayList<String>() {
              {
                for (final ClientResourceType resourceType :
                    clientTypeRegistry.getRegisteredTypes()) {
                  add(resourceType.getShortName());
                }
              }
            }));
  }
  @Inject
  public LayoutEditorView(LayoutEditorWidget layoutEditorWidget) {
    initWidget(uiBinder.createAndBindUi(this));
    this.layoutEditorWidget = layoutEditorWidget;

    accordion.setId(DOM.createUniqueId());
    anchor1.setDataParent(accordion.getId());
    anchor1.setDataTargetWidget(collapseOne);

    anchor2.setDataParent(accordion.getId());
    anchor2.setDataTargetWidget(collapseTwo);
  }
  private void createAnnotationAccordionGroup(
      final Annotation annotation, final AnnotationSource annotationSource) {

    final Panel container = new Panel();
    final PanelHeader header = new PanelHeader();
    final PanelCollapse collapse = new PanelCollapse();
    final PanelBody body = new PanelBody();

    container.add(header);
    collapse.add(body);
    container.add(collapse);

    final Button remove = new Button();
    remove.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(final ClickEvent clickEvent) {
            presenter.onDeleteAnnotation(annotation);
          }
        });
    remove.setPull(Pull.RIGHT);
    remove.setIcon(IconType.TRASH);
    remove.setType(ButtonType.DANGER);
    remove.setSize(ButtonSize.SMALL);
    remove.getElement().getStyle().setMarginTop(-4, Style.Unit.PX);
    header.add(remove);

    final Heading heading = new Heading(HeadingSize.H4);
    final Anchor anchor = new Anchor();
    anchor.setText(accordionHeading(annotation));
    anchor.setDataToggle(Toggle.COLLAPSE);
    anchor.setDataParent(accordionsContainer.getId());
    anchor.setDataTargetWidget(collapse);
    anchor.addStyleName("collapsed");
    heading.add(anchor);
    header.add(heading);

    accordionsContainer.add(container);

    if (annotation.getAnnotationDefinition() != null
        && annotation.getAnnotationDefinition().getValuePairs() != null) {
      for (AnnotationValuePairDefinition valuePairDefinition :
          annotation.getAnnotationDefinition().getValuePairs()) {
        body.add(createValuePairItem(annotation, valuePairDefinition, annotationSource));
      }
    }
  }
 @Override
 public void removeAnnotation(Annotation annotation) {
   final Panel accordionGroup = annotationAccordion.get(annotation);
   if (accordionGroup != null) {
     accordionsContainer.remove(accordionGroup);
     annotationAccordion.remove(annotation);
   }
 }
 public AdvancedAnnotationListEditorViewImpl() {
   initWidget(uiBinder.createAndBindUi(this));
   accordionsContainer.setId(DOM.createUniqueId());
 }
 @Override
 public void clear() {
   accordionsContainer.clear();
 }