Class JmixFileUploadField<C extends AbstractSingleUploadField<C,byte[]>>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,V>
io.jmix.flowui.kit.component.upload.AbstractSingleUploadField<C,byte[]>
io.jmix.flowui.kit.component.upload.JmixFileUploadField<C>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,byte[]>,byte[]>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,byte[]>,byte[]>, com.vaadin.flow.component.shared.HasTooltip, Serializable
Direct Known Subclasses:
FileUploadField

public class JmixFileUploadField<C extends AbstractSingleUploadField<C,byte[]>> extends AbstractSingleUploadField<C,byte[]>
See Also:
  • Field Details

    • fileName

      protected String fileName
    • uploadedFileName

      protected String uploadedFileName
  • Constructor Details

    • JmixFileUploadField

      public JmixFileUploadField()
    • JmixFileUploadField

      public JmixFileUploadField(byte[] defaultValue)
  • Method Details

    • getFileName

      @Nullable public String getFileName()
      Returns:
      file name to be shown in the component next to upload button
    • setFileName

      public void setFileName(@Nullable String fileName)
      Sets file name to be shown in the component next to upload button. The file name of the newly uploaded file will rewrite the caption.

      The default value is "attachment (file_size Kb)". See also message key "fileUploadField.noFileName".

      Parameters:
      fileName - file name to show
    • getUploadedFileName

      @Nullable public String getUploadedFileName()
      Returns:
      name of the uploaded file or null if no file was uploaded using "Upload" button
    • generateFileName

      protected String generateFileName()
      Specified by:
      generateFileName in class AbstractSingleUploadField<C extends AbstractSingleUploadField<C,byte[]>,byte[]>
    • convertValueToFileName

      protected String convertValueToFileName(byte[] value)
    • getDefaultUploadText

      protected String getDefaultUploadText()
      Specified by:
      getDefaultUploadText in class AbstractSingleUploadField<C extends AbstractSingleUploadField<C,byte[]>,byte[]>
    • onSucceededEvent

      protected void onSucceededEvent(com.vaadin.flow.component.upload.SucceededEvent event)
      Overrides:
      onSucceededEvent in class AbstractSingleUploadField<C extends AbstractSingleUploadField<C,byte[]>,byte[]>
    • saveFile

      protected void saveFile(com.vaadin.flow.component.upload.SucceededEvent event)
    • setInternalValue

      protected void setInternalValue(@Nullable byte[] value, boolean fromClient)
      Overrides:
      setInternalValue in class AbstractSingleUploadField<C extends AbstractSingleUploadField<C,byte[]>,byte[]>
    • valueEquals

      protected boolean valueEquals(@Nullable byte[] a, @Nullable byte[] b)
      Overrides:
      valueEquals in class com.vaadin.flow.component.AbstractField<C extends AbstractSingleUploadField<C,byte[]>,byte[]>