Class CmsFileInput
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.CmsWidget
-
- org.opencms.gwt.client.ui.input.upload.CmsFileInput
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasChangeHandlers
,com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.ui.HasName
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.IsWidget
public class CmsFileInput extends CmsWidget implements com.google.gwt.user.client.ui.HasName, com.google.gwt.event.dom.client.HasChangeHandlers
A file input field.- Since:
- 8.0.0
-
-
Constructor Summary
Constructors Constructor Description CmsFileInput()
The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistration
addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler handler)
CmsFileInfo[]
getFiles()
Returns an array of CmsFile objects.java.lang.String
getName()
boolean
isAllowedMultipleFiles()
Returnstrue
if multiple file selection is allowed,false
otherwise.boolean
isDisabled()
Returnstrue
if the input field is disabledfalse
otherwise.void
onAttach()
void
onDetach()
void
setAccept(java.lang.String acceptAttribute)
Sets the 'accept' attribute.void
setAllowMultipleFiles(boolean allow)
Sets the the flag for allowing multiple file selection.void
setDisabled(boolean disabled)
Sets the disabled flag.void
setName(java.lang.String name)
void
setParent(com.google.gwt.user.client.ui.Widget parent)
Overriding to increase method visibility.boolean
supportsFileAPI()
Returnstrue
if the control supports the HTML5 FileAPI andfalse
otherwise.-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
-
-
-
Constructor Detail
-
CmsFileInput
public CmsFileInput()
The default constructor.
-
-
Method Detail
-
addChangeHandler
public com.google.gwt.event.shared.HandlerRegistration addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler handler)
- Specified by:
addChangeHandler
in interfacecom.google.gwt.event.dom.client.HasChangeHandlers
- See Also:
HasChangeHandlers.addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler)
-
getFiles
public CmsFileInfo[] getFiles()
Returns an array of CmsFile objects.- Returns:
- an array of CmsFile objects
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacecom.google.gwt.user.client.ui.HasName
- See Also:
HasName.getName()
-
isAllowedMultipleFiles
public boolean isAllowedMultipleFiles()
Returnstrue
if multiple file selection is allowed,false
otherwise.- Returns:
true
if multiple file selection is allowed,false
otherwise
-
isDisabled
public boolean isDisabled()
Returnstrue
if the input field is disabledfalse
otherwise.- Returns:
true
if the input field is disabledfalse
otherwise
-
onAttach
public void onAttach()
- Overrides:
onAttach
in classcom.google.gwt.user.client.ui.Widget
- See Also:
Widget.onAttach()
-
onDetach
public void onDetach()
- Overrides:
onDetach
in classcom.google.gwt.user.client.ui.Widget
- See Also:
Widget.onDetach()
-
setAccept
public void setAccept(java.lang.String acceptAttribute)
Sets the 'accept' attribute.- Parameters:
acceptAttribute
- the new value for the 'accept' attribute
-
setAllowMultipleFiles
public void setAllowMultipleFiles(boolean allow)
Sets the the flag for allowing multiple file selection.- Parameters:
allow
-true
if the multiple file selection should be allowed
-
setDisabled
public void setDisabled(boolean disabled)
Sets the disabled flag.- Parameters:
disabled
-true
if the input field should be disabled
-
setName
public void setName(java.lang.String name)
- Specified by:
setName
in interfacecom.google.gwt.user.client.ui.HasName
- See Also:
HasName.setName(java.lang.String)
-
setParent
public void setParent(com.google.gwt.user.client.ui.Widget parent)
Description copied from class:CmsWidget
Overriding to increase method visibility.- Overrides:
setParent
in classCmsWidget
- See Also:
CmsWidget.setParent(com.google.gwt.user.client.ui.Widget)
-
supportsFileAPI
public boolean supportsFileAPI()
Returnstrue
if the control supports the HTML5 FileAPI andfalse
otherwise.- Returns:
true
if the control supports the HTML5 FileAPI andfalse
otherwise
-
-