Class JsonFileChooserAcceptAttributeBuilder
- java.lang.Object
-
- org.eclipse.scout.rt.ui.html.json.basic.filechooser.JsonFileChooserAcceptAttributeBuilder
-
@Bean public class JsonFileChooserAcceptAttributeBuilder extends Object
Microsoft internet explorer is not correctly handlig mime types in the 'accept' atttribute.For example valid text/csv is not recognized.
Therefore as a fallback for IE only we use file extensions for selected white-listed types.
This bean builds the content of the accept attribute in
<input accept="file_extension|audio/*|video/*|image/*|media_type">
- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description JsonFileChooserAcceptAttributeBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
build()
protected String
convertToAcceptType(String mimeType, String ext)
JsonFileChooserAcceptAttributeBuilder
withType(String mimeTypeOrExtension)
append the media type to the listJsonFileChooserAcceptAttributeBuilder
withTypes(Collection<String> mimeTypeOrExtensions)
append the collection of media types to the list
-
-
-
Method Detail
-
withTypes
public JsonFileChooserAcceptAttributeBuilder withTypes(Collection<String> mimeTypeOrExtensions)
append the collection of media types to the listuse
build()
to finish building and get the result set- Returns:
- this for method chaining used in fluent api
-
withType
public JsonFileChooserAcceptAttributeBuilder withType(String mimeTypeOrExtension)
append the media type to the listuse
build()
to finish building and get the result set- Returns:
- this for method chaining used in fluent api
-
convertToAcceptType
protected String convertToAcceptType(String mimeType, String ext)
- Parameters:
mimeType
- never nullext
- without leading '*' or '.'. May be null.- Returns:
- the text used in the accept tag in the input element, never null
typically this is the mime type or the file extension with a leading '.'
-
-