Class FileUpload
java.lang.Object
org.patternfly.component.BaseComponent<HTMLElement, FileUpload>
org.patternfly.component.upload.FileUpload
- All Implemented Interfaces:
ElementAttributeMethods<HTMLElement, FileUpload>, ElementClassListMethods<HTMLElement, FileUpload>, ElementConsumerMethods<HTMLElement, FileUpload>, ElementContainerDelegate<HTMLElement, FileUpload>, ElementContainerMethods<HTMLElement, FileUpload>, ElementEventMethods<HTMLElement, FileUpload>, ElementIdMethods<HTMLElement, FileUpload>, ElementQueryMethods<HTMLElement>, HTMLElementAttributeMethods<HTMLElement, FileUpload>, HTMLElementDataMethods<HTMLElement, FileUpload>, HTMLElementStyleMethods<HTMLElement, FileUpload>, HTMLElementVisibilityMethods<HTMLElement, FileUpload>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, FileUpload>, Component, Validatable<HTMLElement, FileUpload>, OuiaSupport<HTMLElement, FileUpload>, Modifiers.Disabled<HTMLElement, FileUpload>, Modifiers.Required<HTMLElement, FileUpload>
public class FileUpload
extends BaseComponent<HTMLElement, FileUpload>
implements Modifiers.Disabled<HTMLElement, FileUpload>, ElementContainerDelegate<HTMLElement, FileUpload>, Modifiers.Required<HTMLElement, FileUpload>, Validatable<HTMLElement, FileUpload>
A file upload component allows users to select and upload files by browsing or dragging and dropping.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionRestricts the accepted file types.add(HelperText helperText) Adds helper text below the component.addHelperText(HelperText helperText) Adds helper text below the component.allowEditingUploadedText(boolean allowEdit) voidclear()Clears the filename, file content, and resets the file input.clearButtonText(String text) Sets the text for the clear button.details()Returns the file details text content.voiddisabled(boolean disabled) Adds/removes modifier(disabled)static FileUploadfileUpload(String id) Hides the file details textarea below the file select area.hideDetails(boolean hideDetails) Shows or hides the file details textarea below the file select area.loading()Same as loading(true)loading(boolean loading) Shows or hides the loading spinner.maxSize(long maxSize) Restricts the maximum file size in bytes.onClear(ComponentHandler<FileUpload> handler) onDataChange(ChangeHandler<FileUpload, String> handler) onFileChange(ChangeHandler<FileUpload, File> handler) onFileReadFailed(FileErrorHandler handler) onFileReadFinished(FileReadHandler handler) onFileReadStart(FileReadHandler handler) onFileRejected(FileRejectedHandler handler) placeholder(String placeholder) Sets the placeholder text for the filename input.readonly()Makes the file details textarea read-only.readonly(boolean readonly) Makes or unmakes the file details textarea read-only.voidthat()type(FileReaderType type) uploadButtonText(String text) Sets the text for the upload button.validated(ValidationStatus status) Returns the current validation status.Methods inherited from class BaseComponent
componentType, element, ouiaComponentType, registerComponentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hiddenMethods inherited from interface Modifiers.Disabled
disabled, isDisabledMethods inherited from interface Modifiers.Required
required, requiredMethods inherited from interface OuiaSupport
initOuia, ouiaId, ouiaSafe, ouiaTransition
-
Method Details
-
fileUpload
-
containerDelegate
- Specified by:
containerDelegatein interfaceElementContainerDelegate<HTMLElement, FileUpload>
-
add
- Specified by:
addin interfaceElementContainerDelegate<HTMLElement, FileUpload>- Specified by:
addin interfaceElementContainerMethods<HTMLElement, FileUpload>
-
add
- Specified by:
addin interfaceElementContainerDelegate<HTMLElement, FileUpload>- Specified by:
addin interfaceElementContainerMethods<HTMLElement, FileUpload>
-
add
- Specified by:
addin interfaceElementContainerDelegate<HTMLElement, FileUpload>- Specified by:
addin interfaceElementContainerMethods<HTMLElement, FileUpload>
-
addHelperText
Adds helper text below the component. -
add
Adds helper text below the component. -
allowEditingUploadedText
-
allowEditingUploadedText
-
hideDetails
Hides the file details textarea below the file select area. -
hideDetails
Shows or hides the file details textarea below the file select area. -
placeholder
Sets the placeholder text for the filename input. -
clearButtonText
Sets the text for the clear button. -
uploadButtonText
Sets the text for the upload button. -
accept
Restricts the accepted file types. The value is a comma-separated list of file extensions (e.g..csv), MIME types (e.g.text/csv), or wildcard MIME types (e.g.image/*). The value is used asacceptattribute of the file input and to validate files that are selected or dropped. Files that don't match are rejected and reported to the handlers registered withonFileRejected(FileRejectedHandler). -
maxSize
Restricts the maximum file size in bytes. Files that are larger are rejected and reported to the handlers registered withonFileRejected(FileRejectedHandler). A value<= 0means no restriction. -
type
-
loading
Same as loading(true) -
loading
Shows or hides the loading spinner. -
disabled
Description copied from interface:Modifiers.DisabledAdds/removes modifier(disabled)- Specified by:
disabledin interfaceModifiers.Disabled<HTMLElement, FileUpload>
-
readonly
Makes the file details textarea read-only. -
readonly
Makes or unmakes the file details textarea read-only. -
validated
- Specified by:
validatedin interfaceValidatable<HTMLElement, FileUpload>
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement, FileUpload>
-
onFileReadStart
-
onFileReadFinished
-
onFileReadFailed
-
onFileRejected
-
onClear
-
onFileChange
-
onDataChange
-
clear
public void clear()Clears the filename, file content, and resets the file input. -
resetValidation
public void resetValidation()- Specified by:
resetValidationin interfaceValidatable<HTMLElement, FileUpload>
-
fileInput
-
details
Returns the file details text content. -
details
-
validationStatus
Returns the current validation status.
-