Class UIFileUpload
- All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUIFocusComp, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
- Direct Known Subclasses:
EUIFileUpload
The component is where a client's request to upload files is allowed or refused. The client component raises the remote event REMOTE_REQUEST carrying what it declares - every file's name, type and size. The request then passes three gates, in this order:
- it must be readable (
UploadChannelProps.decodeRequest(PropCnr,GProp)), else the client is answered refusedprotocol; - it must respect this component's own limits:
isMultiple(),getMaxFiles(),getMaxFileSize(),getMaxTotalSize()andgetAccept(), checked on the declared values; - the App must allow it: the listeners (
IUIFileUploadListener.onUploadRequest(UIFileUpload, UploadRequest)) are asked first, then the method tagged with@OnUIUpload; a deny by either wins.
IClientUploadAPI.reserve(UploadRequest, IFileUploadListener)), where the upload service applies its own limits, with this component's link as the listener of the reservation; a request that does not is refused there (IClientUploadAPI.refuse(UploadRequest, String)). Either way the client gets ONE answer. A reservation can only answer a client's request: App code cannot make one.Disposal does not cancel. When the component is disposed of, its link is removed from the reservations it made and nothing else: the transfers continue, heard by the listeners of the client session and of the application session.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface IMessageBox
IMessageBox.IconNested classes/interfaces inherited from interface IVSComponentState
IVSComponentState.StateField Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe camera choice ofgetCapture(): the front camera.static final intThe camera choice ofgetCapture(): none, the files and the gallery are offered.static final intThe camera choice ofgetCapture(): the rear camera.static final StringRefusal reason: a file is larger than the component's maximum file size.static final StringRefusal reason: more files than the component takes in one pick or drop.static final StringRefusal reason: the files together are larger than the component's maximum total size.static final StringRefusal reason: a file is of a type the component does not accept.static final intClient to server remote event: the client asks to upload files.Fields inherited from class UIComp
EMPTY, REMOTE_FOCUS_EVENT, styles, vsFieldFields inherited from class PropCnr
EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_IDFields inherited from class GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_ATTR_STRING_SECRET, PROP_USER_1, PROP_USER_2Fields inherited from interface IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EQC_SAVE_RELEVANT_ONLY, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATEFields inherited from interface IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNINGFields inherited from interface IUIComp
ERROR, INFORMATION, NONE, WARNINGConstructor Summary
ConstructorsConstructorDescriptionCreates the component without a name.UIFileUpload(Atom propertyAtom) Creates the component with the specified name.UIFileUpload(Atom propertyAtom, GProp<?>[] newValue) Creates the component with the specified name, initialized to contain theGPropitems.Method Summary
Modifier and TypeMethodDescriptionbooleanaddListener(IUIFileUploadListener listener) Adds a new listener for the upload requests and the files of this component.booleanReturns if the component can be aligned left, right, center, or horizontal fill.booleanReturns if the component can be aligned top, bottom, middle or vertical fill.static StringcheckAccept(String accept) Checks the syntax of accepted types.clone()Creates a clone out of this property.Gets the accepted types.Returns the size of the component in pixels.intGets the camera the picker opens on a device that has one.final intGets the device type: -1=mobile, 0=both, 1=desktop.getGroup()Gets the upload group: carried toIUploadFile.getGroup()of every file of this component, for the App.getHint()Gets the drop hint.intGets the maximum number of files of one pick or drop.longGets the maximum size of one file.longGets the maximum size of the files of one pick or drop together.Returns the method to use for onUIUpload notifications that is attached to this component.Gets the text of the picker button.Gets the IDs of the live reservations made through this component: accepted, and not yet final in every file.protected IClientUploadAPIGets the file upload API of the client session this component belongs to.protected UploadChannelPropsGets the upload channel of the client session this component belongs to: where a request that cannot be read is answered, since noUploadRequestexists to refuse.Gets the text of the Upload button, shown whenisAutoStart()is off.booleanReturns if the component has implicit component horizontal fill.booleanReturns if the component has implicit component vertical fill.booleanGets if the user can cancel a file.booleanGets if the user can pause and resume a file.booleanGets if the user can send a failed file again, as a new reservation.booleanGets if the upload starts at once when files are picked or dropped.booleanGets if one pick or drop may hold several files.booleanGets if a failure of this component's files is shown to the user by IIZI.booleanGets if the drop zone is shown.booleanGets if the file list is shown: per file its name, size, bar, state and controls.booleanGets if the log window is shown: the last 50 events of this component's files.booleanGets if the picker button is shown.booleanGets if the overall progress bar is shown.booleanDoes this component require an explicitly defined height?booleanDoes this component require an explicitly defined width?booleanDoes this component require a height?booleanDoes this component require a width?protected voidonPrepare(ClassReference cr, List<Throwable> errors) Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.protected voidCalled when a property is disposed of by delete/remove in a container, or by the dispose method.voidonRemoteEvent(RemoteEvent event) Called when a remote property event should be processed by this property.booleanremoveListener(IUIFileUploadListener listener) Removes a listener of this component.booleanSets the accepted types.booleansetAllowCancel(boolean isAllowed) Sets if the user can cancel a file.booleansetAllowPause(boolean isAllowed) Sets if the user can pause and resume a file.booleansetAllowRetry(boolean isAllowed) Sets if the user can send a failed file again, as a new reservation.booleansetAutoStart(boolean isAutoStart) Sets if the upload starts at once when files are picked or dropped.booleansetCapture(int capture) Sets the camera the picker opens on a device that has one.booleanSets the upload group.booleanSets the drop hint.booleansetMaxFiles(int maxFiles) Sets the maximum number of files of one pick or drop.booleansetMaxFileSize(long maxFileSize) Sets the maximum size of one file.booleansetMaxTotalSize(long maxTotalSize) Sets the maximum size of the files of one pick or drop together.booleansetMultiple(boolean isMultiple) Sets if one pick or drop may hold several files.booleansetNotices(boolean isNotices) Sets if a failure of this component's files is shown to the user by IIZI.booleansetPickText(String text) Sets the text of the picker button.booleansetShowDrop(boolean isShown) Sets if the drop zone is shown.booleansetShowList(boolean isShown) Sets if the file list is shown.booleansetShowLog(boolean isShown) Sets if the log window is shown.booleansetShowPicker(boolean isShown) Sets if the picker button is shown.booleansetShowProgress(boolean isShown) Sets if the overall progress bar is shown.booleansetUploadText(String text) Sets the text of the Upload button, shown whenisAutoStart()is off.booleanverify(PropVerification verification) Verifies this property container.Methods inherited from class UIComp
add, addMappings, assignFontInfoResolver, canAcceptUIContainerFocus, canFillX, canFillY, canRequestFocus, canRequestFocus, clearErrorMessage, couldRequestFocusIfVirtualized, createStyles, createTitleProp, disconnectVSField, doUpdateVSFieldFromUIComponent, enterVSProcessing, exitVSProcessing, fireSelection, fireSelection, forbiddenGetCustomDataMap, getBadge, getBestVSFieldValueType, getComponentID, getComponentMappings, getCSSClassNames, getErrorMessage, getErrorMessage, getErrorMessageEx, getErrorMessageString, getErrorMessageString, getErrorMessageStringEx, getFirstContainerVSStateFocus, getFixHeight, getFixWidth, getFontInfo, getForcedAlignX, getForcedAlignY, getKStringText, getLayout, getLayoutMgr, getLayoutMgr, getMappedVSComponent, getMessage, getMessageText, getPixelHeight, getPixelWidth, getPredefinedProps, getSize, getStyles, getStyles, getText, getTitle, getTitleKS, getTitlePKS, getTooltip, getTooltipText, getTrigger, getUIPanel, getUIParent, getValue, getValue, getVirtualSpace, getVSField, getVSStateFocus, hasExplicitHeight, hasExplicitWidth, hasFocus, hasImplicitHeight, hasImplicitWidth, hasSelectionChanged, initPropCnr, invokeOnUICreateTree, isEnabled, isMobile, isReadOnly, isRTL, isVisible, isVSFieldDisconnected, onBroken, onComponentSelectedInParent, onEventSelf, onFocusGained, onNotifySelectionChanged, onParentStateChanged, onPrepare, onResolved, onSelectionChanged, onStateChanged, onValueChanged, processVSComponentSelection, reconnectVSField, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusEx, requestFocusEx, requestFocusEx, requestFocusEx, resetComponentID, setBadge, setBadge, setComponentToVSField, setCSSClassNames, setCSSClassNames2, setEnabled, setEnabled, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setHTMLText, setLayoutMgr, setMessage, setMessage, setReadOnly, setReadOnly, setText, setText, setTitle, setTitle, setTitle, setTooltip, setTooltip, setUIContainerFocus, setVisible, setVisible, setVSFieldMessageToComponent, setVSFieldToComponent, verifyComponentScopeMethods inherited from class PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, completeVirtualize, containsProp, containsProp, convertLoadedProp, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializePropTree, initializeValue, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isPropValueTreeLockNeeded, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualizeMethods inherited from class GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hashCode, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropErrorPersisted, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropForEditorAtCreation, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropSaveRelevant, isPropSecret, isPropSecretCapable, isPropUSER, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onInitialize, onPropInvalidateCache, onPropParentChanged, onPropValueSet, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropSecret, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toShortString, toShortString, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IComponent
messageBoxMethods inherited from interface ICustomDataProvider
getCustomData, putCustomData, putCustomDataIfAbsentMethods inherited from interface IFocusComp
requestFocus, requestFocus, requestFocusEx, requestFocusExMethods inherited from interface IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, getValueClasses, getVSReference, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPropTreeInitialized, removePropError, removePropListener, renameProp, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toElementString, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropType, validatePropValue, warning, warning, warningMethods inherited from interface IMessageBox
messageBox, messageBox, messageBoxMethods inherited from interface IPropCnr
addProp, addProp, addProp2, addProp2, canRequestFocus, canRequestFocus, canRequestFocus, containsProp, containsProp, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, enablePropCommunication, enablePropHashMap, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsError, getExtendsName, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropCnr, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getString, getString, getString, getString, hasFocus, initializeExtendsFramework, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsRoot, isPropAddRemoveAllowed, isPropExtended, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, requestFocus, requestFocusEx, setBool, setBool, setBool, setBool, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, usePropHashMap, usesPropIndex, validateClassInstancesMethods inherited from interface IUIComp
getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIRefMethods inherited from interface IUIFocusComp
onFocusGained, onFocusLost
Field Details
REMOTE_REQUEST
public static final int REMOTE_REQUESTClient to server remote event: the client asks to upload files. Its parameters are those of the upload channel'sRESERVE, with the types the component accepts.- See Also:
REASON_TOO_MANY
Refusal reason: more files than the component takes in one pick or drop.- See Also:
REASON_TOO_LARGE
Refusal reason: a file is larger than the component's maximum file size.- See Also:
REASON_TOTAL_TOO_LARGE
Refusal reason: the files together are larger than the component's maximum total size.- See Also:
REASON_TYPE
Refusal reason: a file is of a type the component does not accept.- See Also:
CAPTURE_NONE
public static final int CAPTURE_NONEThe camera choice ofgetCapture(): none, the files and the gallery are offered.- See Also:
CAPTURE_REAR
CAPTURE_FRONT
Constructor Details
UIFileUpload
public UIFileUpload()Creates the component without a name. The name must be set in all cases using thesetPropertyAtomcall.UIFileUpload
Creates the component with the specified name. All system-reserved names for components begins with "$".- Parameters:
propertyAtom- the name of the component, unique within it's parent.
UIFileUpload
Creates the component with the specified name, initialized to contain theGPropitems. All system-reserved names for components begins with "$".- Parameters:
propertyAtom- The name of the component, unique within it's parent.newValue- The array of all properties the component should have.- Throws:
PropException- when at least one of the properties to initialize the component with is invalid.
Method Details
clone
Creates a clone out of this property. The clone has no listeners, no link and no reservations of its own: the listener holder is never shared between the original and the clone, so a listener added to one is not called for the other.Cloning is used for "virtualization" of a property tree in the server.
Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree!
getDeviceType
public final int getDeviceType()Gets the device type: -1=mobile, 0=both, 1=desktop.- Specified by:
getDeviceTypein interfaceIUIComp
onPrepare
Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.getOnUIUploadMethod
Returns the method to use for onUIUpload notifications that is attached to this component. The method name is not important, but must have the annotation and signature:@OnUIUpload(name = "some/property")
public void onUIUpload(UIUploadEvent event)- Returns:
- The method, or null if none is registered.
getUploadAPI
Gets the file upload API of the client session this component belongs to.- Returns:
- The API, or null if the component is not in the panel tree of a server client session.
getUploadChannel
Gets the upload channel of the client session this component belongs to: where a request that cannot be read is answered, since noUploadRequestexists to refuse.- Returns:
- The channel, or null if the client created none or the component is not in the panel tree of a client session.
onRemoteEvent
Called when a remote property event should be processed by this property.- Specified by:
onRemoteEventin interfaceIGProp<GProp<?>[]>- Overrides:
onRemoteEventin classUIComp- Parameters:
event- The remote event.
onPropDispose
protected void onPropDispose()Called when a property is disposed of by delete/remove in a container, or by the dispose method.The link of this component is removed from the reservations it made, and nothing else: no transfer is cancelled. The files continue to upload, heard by the listeners of the client session and of the application session.
- Overrides:
onPropDisposein classUIComp
mustHaveWidth
public boolean mustHaveWidth()Does this component require a width?- Overrides:
mustHaveWidthin classUIComp- Returns:
- true if the width must be defined and non-zero, false otherwise.
mustHaveHeight
public boolean mustHaveHeight()Does this component require a height?- Overrides:
mustHaveHeightin classUIComp- Returns:
- true if the height must be defined and non-zero, false otherwise.
mustHaveExplicitWidth
public boolean mustHaveExplicitWidth()Does this component require an explicitly defined width?- Overrides:
mustHaveExplicitWidthin classUIComp- Returns:
- true if the width must be defined and non-zero, false otherwise.
mustHaveExplicitHeight
public boolean mustHaveExplicitHeight()Does this component require an explicitly defined height?- Overrides:
mustHaveExplicitHeightin classUIComp- Returns:
- true if the height must be defined and non-zero, false otherwise.
hasImplicitAlignFillX
public boolean hasImplicitAlignFillX()Returns if the component has implicit component horizontal fill.- Overrides:
hasImplicitAlignFillXin classUIComp- Returns:
- Always true: true means component will always fill the space in X.
hasImplicitAlignFillY
public boolean hasImplicitAlignFillY()Returns if the component has implicit component vertical fill.- Overrides:
hasImplicitAlignFillYin classUIComp- Returns:
- Always: true means component will always fill the space in Y.
canAlignX
canAlignY
getApproximateSize
Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method.- Specified by:
getApproximateSizein classUIComp- Returns:
- The size 320x220.
addListener
Adds a new listener for the upload requests and the files of this component. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeListener
Removes a listener of this component.- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
getReservationIDs
isMultiple
public boolean isMultiple()Gets if one pick or drop may hold several files.- Returns:
true(default) for several files,falsefor one file: a drop of several is then refused.
setMultiple
public boolean setMultiple(boolean isMultiple) Sets if one pick or drop may hold several files.- Parameters:
isMultiple-true(default) for several files,falsefor one file.- Returns:
trueif changed,falsefor no change.
getMaxFiles
public int getMaxFiles()Gets the maximum number of files of one pick or drop.- Returns:
- The maximum, zero (default) for the maximum of the server.
setMaxFiles
public boolean setMaxFiles(int maxFiles) Sets the maximum number of files of one pick or drop. The server clamps it to its own maximum.- Parameters:
maxFiles- The maximum, zero (default) for the maximum of the server.- Returns:
trueif changed,falsefor no change.- Throws:
IllegalArgumentException- IfmaxFilesis less than zero or larger than 10000.
getMaxFileSize
public long getMaxFileSize()Gets the maximum size of one file.- Returns:
- The maximum in bytes, zero (default) for the maximum of the server.
setMaxFileSize
public boolean setMaxFileSize(long maxFileSize) Sets the maximum size of one file.- Parameters:
maxFileSize- The maximum in bytes, zero (default) for the maximum of the server.- Returns:
trueif changed,falsefor no change.- Throws:
IllegalArgumentException- IfmaxFileSizeis less than zero.
getMaxTotalSize
public long getMaxTotalSize()Gets the maximum size of the files of one pick or drop together.- Returns:
- The maximum in bytes, zero (default) for only the quota of the session.
setMaxTotalSize
public boolean setMaxTotalSize(long maxTotalSize) Sets the maximum size of the files of one pick or drop together.- Parameters:
maxTotalSize- The maximum in bytes, zero (default) for only the quota of the session.- Returns:
trueif changed,falsefor no change.- Throws:
IllegalArgumentException- IfmaxTotalSizeis less than zero.
getAccept
Gets the accepted types.- Returns:
- The types in the syntax of the HTML
acceptattribute, separated by comma: a file name extension (.pdf), a family (image/*) or a media type (application/zip); empty (default) for any file. Never null.
setAccept
Sets the accepted types. They are checked on the client, on the declared type and name of a request, and by the upload service on the verified type of the file.- Parameters:
accept- The types in the syntax of the HTMLacceptattribute, separated by comma: a file name extension (.pdf), a family (image/*) or a media type (application/zip); null or empty for any file.- Returns:
trueif changed,falsefor no change.- Throws:
IllegalArgumentException- If an entry is neither of the three forms.
isAutoStart
public boolean isAutoStart()Gets if the upload starts at once when files are picked or dropped.- Returns:
true(default) to start at once,falseif the files wait in the list for the Upload button.
setAutoStart
public boolean setAutoStart(boolean isAutoStart) Sets if the upload starts at once when files are picked or dropped.- Parameters:
isAutoStart-true(default) to start at once,falseif the files wait in the list for the Upload button.- Returns:
trueif changed,falsefor no change.
getCapture
public int getCapture()Gets the camera the picker opens on a device that has one.- Returns:
CAPTURE_NONE(default),CAPTURE_REARorCAPTURE_FRONT.
setCapture
public boolean setCapture(int capture) Sets the camera the picker opens on a device that has one. It applies only when the accepted types are images or videos.- Parameters:
capture-CAPTURE_NONE(default),CAPTURE_REARorCAPTURE_FRONT.- Returns:
trueif changed,falsefor no change.- Throws:
IllegalArgumentException- Ifcaptureis not one of the three values.
getGroup
Gets the upload group: carried toIUploadFile.getGroup()of every file of this component, for the App.- Returns:
- The group, empty (default) for none. Never null.
setGroup
Sets the upload group.- Parameters:
group- The group, null or empty for none.- Returns:
trueif changed,falsefor no change.
isNotices
public boolean isNotices()Gets if a failure of this component's files is shown to the user by IIZI.- Returns:
true(default) for the automatic failure notice,falseif the App reports failures itself.
setNotices
public boolean setNotices(boolean isNotices) Sets if a failure of this component's files is shown to the user by IIZI.- Parameters:
isNotices-true(default) for the automatic failure notice,falseif the App reports failures itself.- Returns:
trueif changed,falsefor no change.
getHint
Gets the drop hint.- Returns:
- The text replacing the default hint of the drop zone, null for the default.
setHint
Sets the drop hint.- Parameters:
hint- The text replacing the default hint of the drop zone, null for the default.- Returns:
trueif changed,falsefor no change.
getPickText
Gets the text of the picker button.- Returns:
- The text replacing the default text of the picker button, null for the default.
setPickText
Sets the text of the picker button.- Parameters:
text- The text replacing the default text of the picker button, null for the default.- Returns:
trueif changed,falsefor no change.
getUploadText
Gets the text of the Upload button, shown whenisAutoStart()is off.- Returns:
- The text replacing the default text of the Upload button, null for the default.
setUploadText
Sets the text of the Upload button, shown whenisAutoStart()is off.- Parameters:
text- The text replacing the default text of the Upload button, null for the default.- Returns:
trueif changed,falsefor no change.
isShowDrop
public boolean isShowDrop()Gets if the drop zone is shown. Ignored on touch devices.- Returns:
true(default) if shown.
setShowDrop
public boolean setShowDrop(boolean isShown) Sets if the drop zone is shown. Ignored on touch devices.- Parameters:
isShown-true(default) to show it.- Returns:
trueif changed,falsefor no change.
isShowPicker
public boolean isShowPicker()Gets if the picker button is shown.- Returns:
true(default) if shown.
setShowPicker
public boolean setShowPicker(boolean isShown) Sets if the picker button is shown.- Parameters:
isShown-true(default) to show it.- Returns:
trueif changed,falsefor no change.
isShowProgress
public boolean isShowProgress()Gets if the overall progress bar is shown.- Returns:
true(default) if shown.
setShowProgress
public boolean setShowProgress(boolean isShown) Sets if the overall progress bar is shown.- Parameters:
isShown-true(default) to show it.- Returns:
trueif changed,falsefor no change.
isShowList
public boolean isShowList()Gets if the file list is shown: per file its name, size, bar, state and controls.- Returns:
true(default) if shown.
setShowList
public boolean setShowList(boolean isShown) Sets if the file list is shown.- Parameters:
isShown-true(default) to show it.- Returns:
trueif changed,falsefor no change.
isShowLog
public boolean isShowLog()Gets if the log window is shown: the last 50 events of this component's files.- Returns:
trueif shown,false(default) if not.
setShowLog
public boolean setShowLog(boolean isShown) Sets if the log window is shown.- Parameters:
isShown-trueto show it,false(default) to hide it.- Returns:
trueif changed,falsefor no change.
isAllowPause
public boolean isAllowPause()Gets if the user can pause and resume a file.- Returns:
true(default) if the per-file buttons are offered.
setAllowPause
public boolean setAllowPause(boolean isAllowed) Sets if the user can pause and resume a file.- Parameters:
isAllowed-true(default) to offer the per-file buttons.- Returns:
trueif changed,falsefor no change.
isAllowCancel
public boolean isAllowCancel()Gets if the user can cancel a file.- Returns:
true(default) if the per-file button is offered.
setAllowCancel
public boolean setAllowCancel(boolean isAllowed) Sets if the user can cancel a file.- Parameters:
isAllowed-true(default) to offer the per-file button.- Returns:
trueif changed,falsefor no change.
isAllowRetry
public boolean isAllowRetry()Gets if the user can send a failed file again, as a new reservation.- Returns:
true(default) if the per-file button is offered.
setAllowRetry
public boolean setAllowRetry(boolean isAllowed) Sets if the user can send a failed file again, as a new reservation.- Parameters:
isAllowed-true(default) to offer the per-file button.- Returns:
trueif changed,falsefor no change.
checkAccept
verify
Verifies this property container.