Class CmsImagePreviewHandler
java.lang.Object
org.opencms.ade.galleries.client.preview.A_CmsPreviewHandler<org.opencms.ade.galleries.shared.CmsImageInfoBean>
org.opencms.ade.galleries.client.preview.CmsImagePreviewHandler
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.ValueChangeHandler<CmsCroppingParamBean>
,com.google.gwt.event.shared.EventHandler
,I_CmsPreviewHandler<org.opencms.ade.galleries.shared.CmsImageInfoBean>
,I_CmsPropertiesHandler
public class CmsImagePreviewHandler
extends A_CmsPreviewHandler<org.opencms.ade.galleries.shared.CmsImageInfoBean>
implements com.google.gwt.event.logical.shared.ValueChangeHandler<CmsCroppingParamBean>
Image preview dialog controller handler.
Delegates the actions of the preview controller to the preview dialog.
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of image tag attribute names. -
Field Summary
Fields inherited from class org.opencms.ade.galleries.client.preview.A_CmsPreviewHandler
m_resourceInfo, m_resourcePreview
-
Constructor Summary
ConstructorDescriptionCmsImagePreviewHandler
(CmsImageResourcePreview resourcePreview) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCroppingChangeHandler
(Runnable action) Adds a handler for cropping changes.void
addImagePointChangeHandler
(Runnable onImagePointChanged) Adds a handler for focal point changes.Returns the image cropping parameter bean.Gets the focal point controller.Gets the format handler.Returns the name of the currently selected image format.void
getImageAttributes
(I_CmsSimpleCallback<Map<String, String>> callback) Returns image tag attributes to set for editor plugins.int
Returns the structure id hash of the previewed image.org.opencms.ade.galleries.shared.CmsImageInfoBean
Gets the image information.getPreviewScaleParam
(int imageHeight, int imageWidth) Returns the cropping parameter.void
onValueChange
(com.google.gwt.event.logical.shared.ValueChangeEvent<CmsCroppingParamBean> event) void
setFormatHandler
(CmsImageFormatHandler formatHandler) Sets the image format handler.void
setImageContainerSize
(int offsetWidth, int offsetHeight) Sets the dimensions of the area the image is going to be placed in.Methods inherited from class org.opencms.ade.galleries.client.preview.A_CmsPreviewHandler
closePreview, getAdditionalWidgetForPropertyTab, getGalleryDialog, saveProperties, selectResource, setDataInEditor, showData
-
Constructor Details
-
CmsImagePreviewHandler
Constructor.- Parameters:
resourcePreview
- the resource preview instance
-
-
Method Details
-
addCroppingChangeHandler
Adds a handler for cropping changes.- Parameters:
action
- the handler to add
-
addImagePointChangeHandler
Adds a handler for focal point changes.- Parameters:
onImagePointChanged
- the handler to add
-
getCroppingParam
Returns the image cropping parameter bean.- Returns:
- the image cropping parameter bean
-
getFocalPointController
Gets the focal point controller.- Returns:
- the focal point controller
-
getFormatHandler
Gets the format handler.- Returns:
- the format handler
-
getFormatName
Returns the name of the currently selected image format.- Returns:
- the format name
-
getImageAttributes
Returns image tag attributes to set for editor plugins.- Parameters:
callback
- the callback to execute
-
getImageIdHash
Returns the structure id hash of the previewed image.- Returns:
- the structure id hash
-
getImageInfo
Gets the image information.- Returns:
- the image information
-
getPreviewScaleParam
Returns the cropping parameter.- Parameters:
imageHeight
- the original image heightimageWidth
- the original image width- Returns:
- the cropping parameter
-
setFormatHandler
Sets the image format handler.- Parameters:
formatHandler
- the format handler
-
setImageContainerSize
Sets the dimensions of the area the image is going to be placed in.- Parameters:
offsetWidth
- the container widthoffsetHeight
- the container height
-