Package org.opencms.ugc.client
Class CmsUgcWrapper
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.SimplePanel
com.google.gwt.user.client.ui.FormPanel
org.opencms.ugc.client.CmsUgcWrapper
- All Implemented Interfaces:
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.AcceptsOneWidget
,com.google.gwt.user.client.ui.FiresFormEvents
,com.google.gwt.user.client.ui.HasOneWidget
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.HasWidgets
,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
,com.google.gwt.user.client.ui.impl.FormPanelImplHost
,com.google.gwt.user.client.ui.IsWidget
,Iterable<com.google.gwt.user.client.ui.Widget>
Widget used to wrap and manage the state of forms for which the form editing API is used.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.FormPanel
com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent, com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler, com.google.gwt.user.client.ui.FormPanel.SubmitEvent, com.google.gwt.user.client.ui.FormPanel.SubmitHandler
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
-
Field Summary
Fields inherited from class com.google.gwt.user.client.ui.FormPanel
ENCODING_MULTIPART, ENCODING_URLENCODED, METHOD_GET, METHOD_POST
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionCmsUgcWrapper
(com.google.gwt.dom.client.Element element, String formSessionId) Wraps an existing form element with this widget. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isFileField
(com.google.gwt.dom.client.InputElement elem) Checks if a form field is a file input field.void
setFormSession
(CmsClientUgcSession session) Sets the form session.void
uploadFields
(Set<String> fields, com.google.common.base.Function<Map<String, String>, Void> filenameCallback, I_CmsErrorCallback errorCallback) Uploads files from the given file input fields.<p<Methods inherited from class com.google.gwt.user.client.ui.FormPanel
addFormHandler, addSubmitCompleteHandler, addSubmitHandler, getAction, getEncoding, getMethod, getTarget, onAttach, onDetach, onFormSubmit, onFrameLoad, removeFormHandler, reset, setAction, setAction, setEncoding, setMethod, submit, wrap, wrap
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CmsUgcWrapper
Wraps an existing form element with this widget.- Parameters:
element
- the form element to wrapformSessionId
- the form session id
-
-
Method Details
-
isFileField
Checks if a form field is a file input field.- Parameters:
elem
- the form field to check- Returns:
- true if the given field is a file input field
-
setFormSession
Sets the form session.- Parameters:
session
- the form session
-
uploadFields
public void uploadFields(Set<String> fields, com.google.common.base.Function<Map<String, String>, Void> filenameCallback, I_CmsErrorCallback errorCallback) Uploads files from the given file input fields.<p<- Parameters:
fields
- the set of names of fields containing the files to uploadfilenameCallback
- the callback to call with the resulting map from field names to file pathserrorCallback
- the callback to call with an error message
-