File Selection Base Component
This abstract class is the base configuration for file inputs. It has two specific implementations:
SingleFileSelectionComponent for handling one file input
MultiFileSelectionComponent for handling an arbitrary amount of files
Both specific implementations only differ in their rendering implementation, but share the same configuration options, like creating a button which has the same options like a pushButton.
Much more important are the configuration functions. You can configure the following aspects:
the accept property
the FileReadingStrategy for interpreting the content of the file
This can be done within a functional expression that is the last parameter of the two files functions, called `build`
. It offers an initialized instance of this FileSelectionBaseComponent class as receiver, so every mutating method can be called for configuring the desired state for rendering the button.
The following example shows the usage (SingleFileSelectionComponent):
file {
accept("application/pdf")
button({
background { color { info } }
}) {
icon { fromTheme { document } }
text("Accept only pdf files")
}
}