Package com.jbstrap.ui.interfaces
Interface FileValueFormItem<T extends FormItem<?,?>>
- All Known Implementing Classes:
FileItem
public interface FileValueFormItem<T extends FormItem<?,?>>
The interface specifies form items whose value is a file.
Such components must have a value of one or several JBFile objects, each representing files as the component�s values.
The interface requires the implementation of methods necessary for the functionality of components that take files as a value. The method descriptions contain guidance on code implementation.
- Since:
- 4.0
- Author:
- JBStrap
-
Method Summary
Modifier and TypeMethodDescriptiongetFileByName(String filename) Uses the file name to gets theJBFilethat was uploaded to the component with the file type.getId()setFileDeleteHandler(FileDeleteHandler fileDeleteHandler) Specifies the handler used to delete a file.setFileUploadedPercent(JBFile file, long chunkSize) Event handler for the �file upload status changed� event.
The method is called if the file upload status has changed, that is, a new file packet has been transferred to the server.
-
Method Details
-
getId
String getId()- Returns:
- Unique component ID
-
getClient
Client getClient()- Returns:
- Client instance or
nullif the component is not added to a client
-
setFileUploadedPercent
Event handler for the �file upload status changed� event.
The method is called if the file upload status has changed, that is, a new file packet has been transferred to the server.- Parameters:
file- TheJBFileobject representing the filechunkSize- THe current chunk size- Returns:
- Form item containing file values
-
getFileByName
Uses the file name to gets theJBFilethat was uploaded to the component with the file type.- Parameters:
filename- File name in theJBFile- Returns:
- The
JBFilewith the#getFileName()identical to the one in the parameter
-
setFileDeleteHandler
Specifies the handler used to delete a file. The handler must implement theFileDeleteHandlerinterface.- Parameters:
fileDeleteHandler- The file delete handler- Returns:
- The component
-