|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper
public class BasicFileItemWrapper
Base Implementation of FileItemWrapper
.
This class perform the bridge between an Item
and a UploadReceiver
.
During initialization, the Item passed on the constructor populate the local variables.
These local variables are used by the Field to display File informations (like FileName, FileSize...)
When an Upload is performed (Uploaded File is handled by the UploadReceiver),
- the local variables are populated based on the UploadReceiver values
- the Item is also populated based on these values.
Field Summary | |
---|---|
protected long |
fileSize
|
protected AbstractJcrNodeAdapter |
item
|
Constructor Summary | |
---|---|
BasicFileItemWrapper(AbstractJcrNodeAdapter jcrItem,
File tmpDirectory)
|
|
BasicFileItemWrapper(File tmpDirectory)
|
Method Summary | |
---|---|
void |
clearProperties()
Clear the local variables. |
String |
getExtension()
|
File |
getFile()
|
protected com.vaadin.data.Property<?> |
getFileFormatProperty()
|
String |
getFileName()
|
protected com.vaadin.data.Property<?> |
getFileNameProperty()
Used to access the Item property in order to set the input dataSource of a TextField. |
long |
getFileSize()
|
String |
getMimeType()
|
protected void |
initJcrItemProperty(AbstractJcrNodeAdapter jcrItem)
Initialize a Item Node Adapter with the mandatory File property. |
boolean |
isEmpty()
Return true if the binaryData is not empty. |
void |
populateFromItem(com.vaadin.data.Item jcrItem)
Populate the local variable with the values of the Item . |
void |
populateFromReceiver(UploadReceiver receiver)
Populate the local variables with the values of the {UploadReceiver receiver}. |
protected void |
populateItem()
Update the Item based on the local values. |
protected void |
populateWrapperFromItem()
Populate the wrapper variable based on the current Item. |
protected void |
populateWrapperFromReceiver(UploadReceiver receiver)
Populate this FileItemWrapper with the UploadReceiver informations. |
void |
reloadPrevious()
Used to restore the previous Uploaded File if existing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long fileSize
protected AbstractJcrNodeAdapter item
Constructor Detail |
---|
public BasicFileItemWrapper(File tmpDirectory)
public BasicFileItemWrapper(AbstractJcrNodeAdapter jcrItem, File tmpDirectory)
Method Detail |
---|
public void populateFromItem(com.vaadin.data.Item jcrItem)
Item
.
populateFromItem
in interface FileItemWrapper
protected void populateWrapperFromItem()
public void populateFromReceiver(UploadReceiver receiver)
Item
with this new values.
populateFromReceiver
in interface FileItemWrapper
public void clearProperties()
clearProperties
in interface FileItemWrapper
public void reloadPrevious()
FileItemWrapper
reloadPrevious
in interface FileItemWrapper
public boolean isEmpty()
FileItemWrapper
isEmpty
in interface FileItemWrapper
protected void populateWrapperFromReceiver(UploadReceiver receiver)
FileItemWrapper
with the UploadReceiver
informations.
protected void populateItem()
Item
based on the local values.
protected void initJcrItemProperty(AbstractJcrNodeAdapter jcrItem)
public long getFileSize()
getFileSize
in interface FileItemWrapper
public String getMimeType()
getMimeType
in interface FileItemWrapper
public String getExtension()
getExtension
in interface FileItemWrapper
public String getFileName()
getFileName
in interface FileItemWrapper
public File getFile()
getFile
in interface FileItemWrapper
protected com.vaadin.data.Property<?> getFileNameProperty()
protected com.vaadin.data.Property<?> getFileFormatProperty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |