|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.server.AbstractClientConnector com.vaadin.ui.AbstractComponent com.vaadin.ui.AbstractField<T> com.vaadin.ui.CustomField<Byte[]> info.magnolia.ui.form.field.upload.AbstractUploadField<D>
D
- FileItemWrapper
implemented class.public abstract class AbstractUploadField<D extends FileItemWrapper>
Main implementation of the UploadFile field. This implementation used some
features of UploadField
and associated
classes.
This class handles Upload events and expose functions that allows to customize the 3 main upload states (link to a view Component):
Upload.StartedEvent
.Upload.FinishedEvent
Upload.FailedEvent
Upload
getUpload() : Return the Vaadin Upload Component responsible for the Uploading a File based on a folder.
Nested Class Summary | |
---|---|
protected static class |
AbstractUploadField.InterruptionReason
Simple Enumeration listing all available Interruption reason. |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
---|
com.vaadin.ui.AbstractField.FocusShortcut, com.vaadin.ui.AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents |
---|
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
com.vaadin.server.Sizeable.Unit |
Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
---|
com.vaadin.ui.Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
---|
com.vaadin.data.Buffered.SourceException |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer |
Field Summary |
---|
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
AbstractUploadField(D fileWrapper,
File tmpUploadDirectory,
info.magnolia.i18nsystem.SimpleTranslator i18n)
|
Method Summary | |
---|---|
protected abstract void |
buildCompletedLayout()
Build the Completed Layout. Use the fileWrapper to display file information and Status. |
protected abstract void |
buildEmptyLayout()
Build the Empty Layout. Use the fileWrapper to display file information and Status. |
protected abstract void |
buildInProgressLayout(String uploadedFileMimeType)
Build the in Progress Layout. Generally display a progress bar UploadProgressIndicator and some file information.Refresh of the action bar is handled by refreshInProgressLayout(...) Use the fileWrapper to display file information and Status. |
protected DragAndDropWrapper |
createDropZone(com.vaadin.ui.Component c)
The dropZone is a wrapper around a Component. |
void |
detach()
|
protected abstract void |
displayUploadFailedNote(String fileName)
|
protected abstract void |
displayUploadFinishedNote(String fileName)
|
protected abstract void |
displayUploadInterruptNote(AbstractUploadField.InterruptionReason reason)
|
void |
drop(com.vaadin.event.dd.DragAndDropEvent event)
Drop zone Handler. |
com.vaadin.event.dd.acceptcriteria.AcceptCriterion |
getAcceptCriterion()
Handled by isValidFile(). |
protected DragAndDropWrapper |
getDropZone()
|
protected D |
getFileWrapper()
Used to access the current File Wrapper in order to access the current File Informations. |
protected com.vaadin.ui.HasComponents |
getRootLayout()
|
Class<? extends Byte[]> |
getType()
|
protected com.vaadin.ui.Upload |
getUpload()
|
protected void |
interruptUpload(AbstractUploadField.InterruptionReason reason)
Interrupt upload based on a user Action. |
protected boolean |
isValidFile(com.vaadin.ui.Upload.StartedEvent event)
Define the acceptance Upload Image criteria. |
protected abstract void |
refreshInProgressLayout(long readBytes,
long contentLength,
String fileName)
Update the in Progress Layout. |
void |
setAllowedMimeTypePattern(String allowedMimeTypePattern)
Set the AllowedMimeType. |
void |
setMaxUploadSize(long maxUploadSize)
Define the Maximum Upload File size in bytes. |
protected void |
setRootLayout(com.vaadin.ui.HasComponents root)
|
protected void |
updateDisplay()
Call the correct layout. |
void |
updateProgress(long readBytes,
long contentLength)
Update the Progress Component. |
void |
uploadFailed(com.vaadin.ui.Upload.FailedEvent event)
|
void |
uploadFinished(com.vaadin.ui.Upload.FinishedEvent event)
Handle the Upload.FinishedEvent . |
void |
uploadStarted(com.vaadin.ui.Upload.StartedEvent event)
Start Upload if the file is supported. |
Methods inherited from class com.vaadin.ui.CustomField |
---|
attach, getContent, initContent, iterator, setHeight, setWidth |
Methods inherited from class com.vaadin.ui.AbstractField |
---|
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, commit, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getState, getTabIndex, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, shouldHideErrors, toString, validate, validate, valueChange |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setIcon, setId, setImmediate, setParent, setPrimaryStyleName, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth |
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier |
---|
addShortcutListener, removeShortcutListener |
Constructor Detail |
---|
public AbstractUploadField(D fileWrapper, File tmpUploadDirectory, info.magnolia.i18nsystem.SimpleTranslator i18n)
Method Detail |
---|
protected abstract void buildEmptyLayout()
protected abstract void buildInProgressLayout(String uploadedFileMimeType)
UploadProgressIndicator
and some file information.
protected abstract void refreshInProgressLayout(long readBytes, long contentLength, String fileName)
protected abstract void buildCompletedLayout()
protected abstract void displayUploadInterruptNote(AbstractUploadField.InterruptionReason reason)
protected abstract void displayUploadFinishedNote(String fileName)
protected abstract void displayUploadFailedNote(String fileName)
protected void updateDisplay()
protected void interruptUpload(AbstractUploadField.InterruptionReason reason)
com.vaadin.server.communication.FileUploadHandler.UploadInterruptedException
will be thrown by the underlying Vaadin classes.
protected boolean isValidFile(com.vaadin.ui.Upload.StartedEvent event)
protected com.vaadin.ui.Upload getUpload()
protected DragAndDropWrapper getDropZone()
protected D getFileWrapper()
protected DragAndDropWrapper createDropZone(com.vaadin.ui.Component c)
public void drop(com.vaadin.event.dd.DragAndDropEvent event)
drop
in interface com.vaadin.event.dd.DropHandler
public com.vaadin.event.dd.acceptcriteria.AcceptCriterion getAcceptCriterion()
getAcceptCriterion
in interface com.vaadin.event.dd.DropHandler
public void uploadStarted(com.vaadin.ui.Upload.StartedEvent event)
uploadStarted
in interface com.vaadin.ui.Upload.StartedListener
public void updateProgress(long readBytes, long contentLength)
updateProgress
in interface com.vaadin.ui.Upload.ProgressListener
public void uploadFinished(com.vaadin.ui.Upload.FinishedEvent event)
Upload.FinishedEvent
. In case of success: Upload.FailedEvent
(this event
is send on a Cancel upload)
uploadFinished
in interface com.vaadin.ui.Upload.FinishedListener
public void uploadFailed(com.vaadin.ui.Upload.FailedEvent event)
uploadFailed
in interface com.vaadin.ui.Upload.FailedListener
public Class<? extends Byte[]> getType()
getType
in interface com.vaadin.data.Property<Byte[]>
getType
in class com.vaadin.ui.AbstractField<Byte[]>
protected com.vaadin.ui.HasComponents getRootLayout()
protected void setRootLayout(com.vaadin.ui.HasComponents root)
public void setAllowedMimeTypePattern(String allowedMimeTypePattern)
UploadField
setAllowedMimeTypePattern
in interface UploadField
public void setMaxUploadSize(long maxUploadSize)
UploadField
setMaxUploadSize
in interface UploadField
public void detach()
detach
in interface com.vaadin.server.ClientConnector
detach
in class com.vaadin.ui.AbstractField<Byte[]>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |