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 Classes
    Modifier and Type
    Class
    Description
    protected 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

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • addFormatSelectOption

      public void addFormatSelectOption(String value, String label)
      Adds a format select option.

      Parameters:
      value - the option value
      label - the option label
    • 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 interface com.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<String> event)
      Specified by:
      onValueChange in interface com.google.gwt.event.logical.shared.ValueChangeHandler<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(String value)
      Sets the format select value.

      Parameters:
      value - the value
    • setFormEnabled

      public void setFormEnabled(boolean enabled)
      Sets the format form enabled.

      Parameters:
      enabled - if true 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, String disableMessage)
      Sets the state of the ratio lock button.

      Parameters:
      down - if true button will be set down / lock open
      enabled - if true button will be enabled
      disableMessage - 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