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
Modifier and TypeClassDescriptionprotected static interface
GWT 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
Modifier and TypeFieldDescriptionprotected CmsPushButton
The cropping button.protected CmsTextBox
The height text box.protected CmsLabel
The height label.protected com.google.gwt.user.client.ui.HTMLPanel
The panel holding the content.protected CmsToggleButton
The ratio lock button.protected CmsPushButton
The remove cropping button.protected CmsPushButton
The reset size button.protected CmsSelectBox
The select box.protected CmsLabel
The select box label.protected CmsTextBox
The width text box.protected CmsLabel
The width label.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFormatSelectOption
(String value, String label) Adds a format select option.Returns the selected format value.int
Returns the height input or -1 if input is empty or not valid.int
Returns the width input or -1 if input is empty or not valid.void
onKeyPress
(com.google.gwt.event.dom.client.KeyPressEvent event) void
onValueChange
(com.google.gwt.event.logical.shared.ValueChangeEvent<String> event) protected void
openCropping
(com.google.gwt.event.dom.client.ClickEvent event) Opens the cropping dialog on crop button click.protected void
removeCropping
(com.google.gwt.event.dom.client.ClickEvent event) Removes the cropping on button click.protected void
resetSize
(com.google.gwt.event.dom.client.ClickEvent event) Resets the size on button click.void
setCropped
(boolean cropped) Enables/disables buttons and input fields necessary if the image if cropped.void
setFormatSelectValue
(String value) Sets the format select value.void
setFormEnabled
(boolean enabled) Sets the format form enabled.void
setHeightInput
(int height) Sets the height input field.void
setHeightInputEnabled
(boolean enabled) Enables the height input field.void
setRatioButton
(boolean down, boolean enabled, String disableMessage) Sets the state of the ratio lock button.void
setWidthInput
(int width) Sets the width input field.void
setWidthInputEnabled
(boolean enabled) Enables the width input field.protected void
toggleRatioLock
(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, setWidget
Methods 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, 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, 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:
onKeyPress
in interfacecom.google.gwt.event.dom.client.KeyPressHandler
- See Also:
-
KeyPressHandler.onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent)
-
setCropped
Enables/disables buttons and input fields necessary if the image if cropped.- Parameters:
cropped
-true
if the image is cropped
-
setFormatSelectValue
Sets the format select value.- Parameters:
value
- the value
-
setFormEnabled
Sets the format form enabled.- Parameters:
enabled
- iftrue
the form will be enabled
-
setHeightInput
Sets the height input field.- Parameters:
height
- the value
-
setHeightInputEnabled
Enables the height input field.- Parameters:
enabled
-true
to enable the input field
-
setRatioButton
Sets the state of the ratio lock button.- Parameters:
down
- iftrue
button will be set down / lock openenabled
- iftrue
button 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
-true
to 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
-