Class CmsImageFormatsForm
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.opencms.ade.galleries.client.preview.ui.CmsImageFormatsForm
- All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyPressHandler,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.ValueChangeHandler<String>,com.google.gwt.event.shared.EventHandler,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget
public class CmsImageFormatsForm
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.logical.shared.ValueChangeHandler<String>, com.google.gwt.event.dom.client.KeyPressHandler
Image format form.
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceGWT ui-binder.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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmsPushButtonThe cropping button.protected CmsTextBoxThe height text box.protected CmsLabelThe height label.protected com.google.gwt.user.client.ui.HTMLPanelThe panel holding the content.protected CmsToggleButtonThe ratio lock button.protected CmsPushButtonThe remove cropping button.protected CmsPushButtonThe reset size button.protected CmsSelectBoxThe select box.protected CmsLabelThe select box label.protected CmsTextBoxThe width text box.protected CmsLabelThe width label.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFormatSelectOption(String value, String label) Adds a format select option.Returns the selected format value.intReturns the height input or -1 if input is empty or not valid.intReturns the width input or -1 if input is empty or not valid.voidonKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event) voidonValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent<String> event) protected voidopenCropping(com.google.gwt.event.dom.client.ClickEvent event) Opens the cropping dialog on crop button click.protected voidremoveCropping(com.google.gwt.event.dom.client.ClickEvent event) Removes the cropping on button click.protected voidresetSize(com.google.gwt.event.dom.client.ClickEvent event) Resets the size on button click.voidsetCropped(boolean cropped) Enables/disables buttons and input fields necessary if the image if cropped.voidsetFormatSelectValue(String value) Sets the format select value.voidsetFormEnabled(boolean enabled) Sets the format form enabled.voidsetHeightInput(int height) Sets the height input field.voidsetHeightInputEnabled(boolean enabled) Enables the height input field.voidsetRatioButton(boolean down, boolean enabled, String disableMessage) Sets the state of the ratio lock button.voidsetWidthInput(int width) Sets the width input field.voidsetWidthInputEnabled(boolean enabled) Enables the width input field.protected voidtoggleRatioLock(com.google.gwt.event.dom.client.ClickEvent event) Toggle the ratio lock on button click.Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetMethods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods 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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Field Details
-
m_cropButton
The cropping button. -
m_heightBox
The height text box. -
m_heightLabel
The height label. -
m_panel
The panel holding the content. -
m_ratioLock
The ratio lock button. -
m_removeCropButton
The remove cropping button. -
m_resetSize
The reset size button. -
m_selectBox
The select box. -
m_selectBoxLabel
The select box label. -
m_widthBox
The width text box. -
m_widthLabel
The width label.
-
-
Constructor Details
-
CmsImageFormatsForm
Constructor.- Parameters:
formatHandler- the image format handler
-
-
Method Details
-
addFormatSelectOption
Adds a format select option.- Parameters:
value- the option valuelabel- the option label
-
getFormatSelectValue
Returns the selected format value.- Returns:
- the selected format value
-
getHeightInput
Returns the height input or -1 if input is empty or not valid.- Returns:
- the height input
-
getWidthInput
Returns the width input or -1 if input is empty or not valid.- Returns:
- the width input
-
onKeyPress
- Specified by:
onKeyPressin interfacecom.google.gwt.event.dom.client.KeyPressHandler- See Also:
-
setCropped
Enables/disables buttons and input fields necessary if the image if cropped.- Parameters:
cropped-trueif the image is cropped
-
setFormatSelectValue
Sets the format select value.- Parameters:
value- the value
-
setFormEnabled
Sets the format form enabled.- Parameters:
enabled- iftruethe form will be enabled
-
setHeightInput
Sets the height input field.- Parameters:
height- the value
-
setHeightInputEnabled
Enables the height input field.- Parameters:
enabled-trueto enable the input field
-
setRatioButton
Sets the state of the ratio lock button.- Parameters:
down- iftruebutton will be set down / lock openenabled- iftruebutton will be enableddisableMessage- message to show for disabled button
-
setWidthInput
Sets the width input field.- Parameters:
width- the value
-
setWidthInputEnabled
Enables the width input field.- Parameters:
enabled-trueto enable the input field
-
openCropping
@UiHandler("m_cropButton") protected void openCropping(com.google.gwt.event.dom.client.ClickEvent event) Opens the cropping dialog on crop button click.- Parameters:
event- the click event
-
removeCropping
@UiHandler("m_removeCropButton") protected void removeCropping(com.google.gwt.event.dom.client.ClickEvent event) Removes the cropping on button click.- Parameters:
event- the click event
-
resetSize
@UiHandler("m_resetSize") protected void resetSize(com.google.gwt.event.dom.client.ClickEvent event) Resets the size on button click.- Parameters:
event- the click event
-
toggleRatioLock
@UiHandler("m_ratioLock") protected void toggleRatioLock(com.google.gwt.event.dom.client.ClickEvent event) Toggle the ratio lock on button click.- Parameters:
event- the click event
-