protected Component buildReportSelection() {
    FormLayout content = new FormLayout();
    content.setSpacing(true);
    // Create reporting selection
    reportSelection =
        ModelBasedFieldFactory.getInstance(entityModel, getMessageService())
            .createEnumCombo(reportDefinition.getClass(), ComboBox.class);
    reportSelection.setCaption(
        getMessageService()
            .getMessage(
                entityModel.getReference() + "." + reportDefinition.getClass().getSimpleName()));
    reportSelection.setNullSelectionAllowed(false);
    reportSelection.setRequired(true);
    reportSelection.select(reportSelection.getItemIds().iterator().next());
    reportSelection.setSizeFull();
    reportSelection.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = -3358229370015557129L;

          @Override
          public void valueChange(Property.ValueChangeEvent event) {
            if (exportPDF != null) {
              exportPDF.setEnabled(false);
            }
          }
        });
    // Add combo
    content.addComponent(reportSelection);
    return content;
  }
 @SuppressWarnings("unchecked")
 public TableFieldFactory getFieldFactory(MessageService messageService) {
   if (fieldFactory == null) {
     fieldFactory =
         (ModelBasedFieldFactory<AbstractEntity<?>>)
             ModelBasedFieldFactory.getInstance(entityModel, messageService);
   }
   return fieldFactory;
 }