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
,java.lang.Iterable<com.google.gwt.user.client.ui.Widget>
public class CmsUgcWrapper extends com.google.gwt.user.client.ui.FormPanel
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
-
-
Constructor Summary
Constructors Constructor Description CmsUgcWrapper(com.google.gwt.dom.client.Element element, java.lang.String formSessionId)
Wraps an existing form element with this widget.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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(java.util.Set<java.lang.String> fields, com.google.common.base.Function<java.util.Map<java.lang.String,java.lang.String>,java.lang.Void> filenameCallback, I_CmsErrorCallback errorCallback)
Uploads files from the given file input fields.-
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
-
-
-
-
Constructor Detail
-
CmsUgcWrapper
public CmsUgcWrapper(com.google.gwt.dom.client.Element element, java.lang.String formSessionId)
Wraps an existing form element with this widget.- Parameters:
element
- the form element to wrapformSessionId
- the form session id
-
-
Method Detail
-
isFileField
public static boolean isFileField(com.google.gwt.dom.client.InputElement elem)
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
public void setFormSession(CmsClientUgcSession session)
Sets the form session.- Parameters:
session
- the form session
-
uploadFields
public void uploadFields(java.util.Set<java.lang.String> fields, com.google.common.base.Function<java.util.Map<java.lang.String,java.lang.String>,java.lang.Void> filenameCallback, I_CmsErrorCallback errorCallback)
Uploads files from the given file input fields.- 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
-
-