public class CmsGalleryField extends com.google.gwt.user.client.ui.Composite implements I_CmsFormWidget, I_CmsHasInit, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>, com.google.gwt.event.logical.shared.HasResizeHandlers, com.google.gwt.event.dom.client.HasFocusHandlers
限定符和类型 | 类和说明 |
---|---|
protected static interface |
CmsGalleryField.I_CmsGalleryFieldUiBinder
The UI Binder interface for this widget.
|
protected class |
CmsGalleryField.OpenCloseHandler
Handler to fire resize event on resource info widget open/close.
|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
I_CmsFormWidget.FieldType
限定符和类型 | 字段和说明 |
---|---|
protected I_CmsGalleryConfiguration |
m_configuration
The gallery configuration.
|
protected CmsCroppingParamBean |
m_croppingParam
The scale parameters from popup.
|
protected com.google.gwt.user.client.ui.Label |
m_fader
The fading element.
|
protected com.google.gwt.dom.client.DivElement |
m_fieldBox
The DIV carrying the input field.
|
protected com.google.gwt.dom.client.DivElement |
m_imagePreview
The image preview element.
|
protected com.google.gwt.user.client.ui.HTMLPanel |
m_main
The main panel.
|
protected CmsPushButton |
m_opener
The button to to open the selection.
|
protected CmsGalleryPopup |
m_popup
The gallery pop-up.
|
protected com.google.gwt.user.client.ui.FlowPanel |
m_resourceInfoPanel
The resource info panel.
|
protected CmsSimpleTextBox |
m_textbox
The textbox containing the currently selected path.
|
protected CmsUploadButton |
m_uploadButton
The upload button.
|
protected com.google.gwt.dom.client.Element |
m_uploadDropZone
The upload drop zone.
|
static java.lang.String |
WIDGET_TYPE
The widget type.
|
构造器和说明 |
---|
CmsGalleryField(I_CmsGalleryConfiguration configuration,
boolean allowUploads)
Constructs a new gallery widget.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addFieldStyleName(java.lang.String styleName)
Adds a style name to the DIV carrying the input field.
|
com.google.gwt.event.shared.HandlerRegistration |
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler) |
protected void |
addToMain(com.google.gwt.user.client.ui.IsWidget widget)
Adds a widget to the main panel.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler) |
protected void |
fireChange(boolean force)
Fires the value change event if the value has changed.
|
protected void |
fireResize()
Fires the resize event for this widget.
|
java.lang.String |
getApparentValue()
Returns the "apparent value", i.e. either the real value if available, or else the ghost value if available, or null otherwise.
|
protected java.lang.String |
getCurrentElement()
Returns the currently set resource path.
|
I_CmsFormWidget.FieldType |
getFieldType()
Returns the type of data this widget produces.
|
java.lang.Object |
getFormValue()
Gets the selected/entered value from the widget.
|
java.lang.String |
getFormValueAsString()
Gets the current value of the widget as a string.
|
protected I_CmsGalleryServiceAsync |
getGalleryService()
Returns the gallery service instance.
|
CmsGalleryPopup |
getPopup()
Returns the gallery popup.
|
static void |
initClass()
Initializes this class.
|
boolean |
isEnabled()
Returns
true if this widget is enabled. |
protected void |
onFocusTextbox(com.google.gwt.event.dom.client.FocusEvent event)
Handles the focus event on the opener.
|
protected void |
openGalleryDialog()
Internal method which opens the gallery dialog.
|
protected boolean |
removeFromMain(com.google.gwt.user.client.ui.IsWidget widget)
Removes the given widget from the main panel.
|
void |
reset()
Resets the widget to its default state.
|
void |
setAutoHideParent(I_CmsAutoHider autoHideParent)
Call this when auto hiding parents are shown.
|
void |
setDropZoneElement(com.google.gwt.dom.client.Element dropZone)
Sets the upload drop zone element.
|
void |
setEnabled(boolean enabled)
Enables or disables the widget.
|
void |
setErrorMessage(java.lang.String errorMessage)
Sets the error message for this widget.
|
void |
setFormValueAsString(java.lang.String value)
Sets the current value of the widget as a string.
|
void |
setGalleryOpenerTitle(java.lang.String openerTitle)
Sets the gallery opener button title.
|
void |
setHasImage(boolean hasImage)
Sets the has image flag.
|
protected void |
setImagePreview(java.lang.String imagePath)
Sets the image preview.
|
void |
setName(java.lang.String name)
Sets the name of the input field.
|
protected void |
setValue(java.lang.String value,
boolean fireEvent)
Sets the widget value.
|
protected void |
setValueFromGallery(java.lang.String resourcePath,
CmsUUID structureId,
CmsCroppingParamBean croppingParameter)
Sets the widget value.
|
protected void |
updateUploadTarget(java.lang.String uploadTarget)
Updates the upload target folder path.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
public static final java.lang.String WIDGET_TYPE
protected I_CmsGalleryConfiguration m_configuration
protected CmsCroppingParamBean m_croppingParam
@UiField protected com.google.gwt.user.client.ui.Label m_fader
@UiField protected com.google.gwt.dom.client.DivElement m_fieldBox
@UiField protected com.google.gwt.dom.client.DivElement m_imagePreview
protected com.google.gwt.user.client.ui.HTMLPanel m_main
@UiField protected CmsPushButton m_opener
protected CmsGalleryPopup m_popup
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_resourceInfoPanel
@UiField protected CmsSimpleTextBox m_textbox
@UiField(provided=true) protected CmsUploadButton m_uploadButton
protected com.google.gwt.dom.client.Element m_uploadDropZone
public CmsGalleryField(I_CmsGalleryConfiguration configuration, boolean allowUploads)
configuration
- the gallery configurationallowUploads
- states if the upload button should be enabled for this widgetpublic static void initClass()
public void addFieldStyleName(java.lang.String styleName)
styleName
- the style name to addpublic com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
addFocusHandler
在接口中 com.google.gwt.event.dom.client.HasFocusHandlers
HasFocusHandlers.addFocusHandler(com.google.gwt.event.dom.client.FocusHandler)
public com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
addResizeHandler
在接口中 com.google.gwt.event.logical.shared.HasResizeHandlers
HasResizeHandlers.addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler)
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)
addValueChangeHandler
在接口中 com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>
HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
public java.lang.String getApparentValue()
I_CmsFormWidget
getApparentValue
在接口中 I_CmsFormWidget
I_CmsFormWidget.getApparentValue()
public I_CmsFormWidget.FieldType getFieldType()
I_CmsFormWidget
getFieldType
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFieldType()
public java.lang.Object getFormValue()
I_CmsFormWidget
getFormValue
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFormValue()
public java.lang.String getFormValueAsString()
I_CmsFormWidget
getFormValueAsString
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFormValueAsString()
public CmsGalleryPopup getPopup()
public boolean isEnabled()
I_CmsFormWidget
true
if this widget is enabled.isEnabled
在接口中 I_CmsFormWidget
true
if this widget is enabledI_CmsFormWidget.isEnabled()
public void reset()
I_CmsFormWidget
reset
在接口中 I_CmsFormWidget
I_CmsFormWidget.reset()
public void setAutoHideParent(I_CmsAutoHider autoHideParent)
I_CmsFormWidget
setAutoHideParent
在接口中 I_CmsFormWidget
autoHideParent
- the auto hide parentI_CmsFormWidget.setAutoHideParent(org.opencms.gwt.client.ui.I_CmsAutoHider)
public void setDropZoneElement(com.google.gwt.dom.client.Element dropZone)
dropZone
- the upload drop zone elementpublic void setEnabled(boolean enabled)
I_CmsFormWidget
setEnabled
在接口中 I_CmsFormWidget
enabled
- if true, the widget will be enabled, else disabledI_CmsFormWidget.setEnabled(boolean)
public void setErrorMessage(java.lang.String errorMessage)
I_CmsFormWidget
If the error message is null, no error message will be displayed.
setErrorMessage
在接口中 I_CmsFormWidget
errorMessage
- an error message or nullI_CmsFormWidget.setErrorMessage(java.lang.String)
public void setFormValueAsString(java.lang.String value)
I_CmsFormWidget
setFormValueAsString
在接口中 I_CmsFormWidget
value
- the new value of the widgetI_CmsFormWidget.setFormValueAsString(java.lang.String)
public void setGalleryOpenerTitle(java.lang.String openerTitle)
openerTitle
- the gallery opener button titlepublic void setHasImage(boolean hasImage)
hasImage
- the has image flagpublic void setName(java.lang.String name)
name
- of the input fieldprotected void addToMain(com.google.gwt.user.client.ui.IsWidget widget)
widget
- the widget to addprotected void fireChange(boolean force)
force
- true
to force firing the event in any caseprotected void fireResize()
protected java.lang.String getCurrentElement()
protected I_CmsGalleryServiceAsync getGalleryService()
@UiHandler(value="m_textbox") protected void onFocusTextbox(com.google.gwt.event.dom.client.FocusEvent event)
event
- protected void openGalleryDialog()
protected boolean removeFromMain(com.google.gwt.user.client.ui.IsWidget widget)
widget
- the widget to removetrue
if the widget was a child of the main panelprotected void setImagePreview(java.lang.String imagePath)
imagePath
- the image pathprotected void setValue(java.lang.String value, boolean fireEvent)
value
- the value to setfireEvent
- if the change event should be firedprotected void setValueFromGallery(java.lang.String resourcePath, CmsUUID structureId, CmsCroppingParamBean croppingParameter)
resourcePath
- the selected resource pathstructureId
- the resource structure idcroppingParameter
- the selected croppingprotected void updateUploadTarget(java.lang.String uploadTarget)
uploadTarget
- the upload target folder