private Window createRegisterEntityTypeDialog(final EntityKind entityKind) {
    String title =
        viewContext.getMessage(Dict.ADD_TYPE_TITLE_TEMPLATE, entityKind.getDescription());

    T newEntityType = createNewEntityType();
    return createRegisterEntityTypeDialog(title, newEntityType);
  }
  protected Window createEditEntityTypeDialog(final EntityKind entityKind, final T entityType) {
    final String code = entityType.getCode();
    String title =
        viewContext.getMessage(Dict.EDIT_TYPE_TITLE_TEMPLATE, entityKind.getDescription(), code);
    return new AbstractRegistrationDialog(viewContext, title, postRegistrationCallback) {
      private final DescriptionField descriptionField;

      {
        descriptionField = createDescriptionField(viewContext);
        descriptionField.setValueAndUnescape(entityType.getDescription());
        addField(descriptionField);
      }

      @Override
      protected void register(AsyncCallback<Void> registrationCallback) {
        entityType.setDescription(descriptionField.getValue());
        viewContext.getService().updateEntityType(entityKind, entityType, registrationCallback);
      }
    };
  }