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<java.lang.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<java.lang.String>, com.google.gwt.event.dom.client.KeyPressHandler
Image format form.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
CmsImageFormatsForm.I_CmsImageFormatsFormUiBinder
GWT ui-binder.
-
Field Summary
Fields Modifier and Type Field Description protected CmsPushButton
m_cropButton
The cropping button.protected CmsTextBox
m_heightBox
The height text box.protected CmsLabel
m_heightLabel
The height label.protected com.google.gwt.user.client.ui.HTMLPanel
m_panel
The panel holding the content.protected CmsToggleButton
m_ratioLock
The ratio lock button.protected CmsPushButton
m_removeCropButton
The remove cropping button.protected CmsPushButton
m_resetSize
The reset size button.protected CmsSelectBox
m_selectBox
The select box.protected CmsLabel
m_selectBoxLabel
The select box label.protected CmsTextBox
m_widthBox
The width text box.protected CmsLabel
m_widthLabel
The width label.
-
Constructor Summary
Constructors Constructor Description CmsImageFormatsForm(CmsImageFormatHandler formatHandler)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFormatSelectOption(java.lang.String value, java.lang.String label)
Adds a format select option.java.lang.String
getFormatSelectValue()
Returns the selected format value.int
getHeightInput()
Returns the height input or -1 if input is empty or not valid.int
getWidthInput()
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<java.lang.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(java.lang.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, java.lang.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 Detail
-
m_cropButton
@UiField protected CmsPushButton m_cropButton
The cropping button.
-
m_heightBox
@UiField protected CmsTextBox m_heightBox
The height text box.
-
m_heightLabel
@UiField protected CmsLabel m_heightLabel
The height label.
-
m_panel
@UiField protected com.google.gwt.user.client.ui.HTMLPanel m_panel
The panel holding the content.
-
m_ratioLock
@UiField protected CmsToggleButton m_ratioLock
The ratio lock button.
-
m_removeCropButton
@UiField protected CmsPushButton m_removeCropButton
The remove cropping button.
-
m_resetSize
@UiField protected CmsPushButton m_resetSize
The reset size button.
-
m_selectBox
@UiField protected CmsSelectBox m_selectBox
The select box.
-
m_selectBoxLabel
@UiField protected CmsLabel m_selectBoxLabel
The select box label.
-
m_widthBox
@UiField protected CmsTextBox m_widthBox
The width text box.
-
m_widthLabel
@UiField protected CmsLabel m_widthLabel
The width label.
-
-
Constructor Detail
-
CmsImageFormatsForm
public CmsImageFormatsForm(CmsImageFormatHandler formatHandler)
Constructor.- Parameters:
formatHandler
- the image format handler
-
-
Method Detail
-
addFormatSelectOption
public void addFormatSelectOption(java.lang.String value, java.lang.String label)
Adds a format select option.- Parameters:
value
- the option valuelabel
- the option label
-
getFormatSelectValue
public java.lang.String getFormatSelectValue()
Returns the selected format value.- Returns:
- the selected format value
-
getHeightInput
public int getHeightInput()
Returns the height input or -1 if input is empty or not valid.- Returns:
- the height input
-
getWidthInput
public int getWidthInput()
Returns the width input or -1 if input is empty or not valid.- Returns:
- the width input
-
onKeyPress
public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
- Specified by:
onKeyPress
in interfacecom.google.gwt.event.dom.client.KeyPressHandler
- See Also:
KeyPressHandler.onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent)
-
onValueChange
public void onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
- Specified by:
onValueChange
in interfacecom.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String>
- See Also:
ValueChangeHandler.onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
-
setCropped
public void setCropped(boolean cropped)
Enables/disables buttons and input fields necessary if the image if cropped.- Parameters:
cropped
-true
if the image is cropped
-
setFormatSelectValue
public void setFormatSelectValue(java.lang.String value)
Sets the format select value.- Parameters:
value
- the value
-
setFormEnabled
public void setFormEnabled(boolean enabled)
Sets the format form enabled.- Parameters:
enabled
- iftrue
the form will be enabled
-
setHeightInput
public void setHeightInput(int height)
Sets the height input field.- Parameters:
height
- the value
-
setHeightInputEnabled
public void setHeightInputEnabled(boolean enabled)
Enables the height input field.- Parameters:
enabled
-true
to enable the input field
-
setRatioButton
public void setRatioButton(boolean down, boolean enabled, java.lang.String disableMessage)
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
public void setWidthInput(int width)
Sets the width input field.- Parameters:
width
- the value
-
setWidthInputEnabled
public void setWidthInputEnabled(boolean enabled)
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
-
-