Class CmsFormRow

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, 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, I_CmsTruncable

    public class CmsFormRow
    extends com.google.gwt.user.client.ui.Composite
    implements I_CmsTruncable
    A row in a properties form.

    This widget contains both a label and a panel into which an input widget for the form field can be placed. These widgets are next to each other horizontally.

    Since:
    8.0.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static interface  CmsFormRow.I_CmsFormRowUiBinder
      The ui binder interface for this widget.
      • 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 static I_CmsInputCss CSS
      The CSS bundle used for this widget.
      static java.util.List<java.lang.String> ICON_STYLES
      List of style names for the help icon.
      static int LABEL_WIDTH
      The width of the label.
      protected com.google.gwt.user.client.ui.Panel m_icon
      The label used for displaying the information icon.
      protected com.google.gwt.user.client.ui.Label m_label
      The label for the form row.
      protected com.google.gwt.user.client.ui.Panel m_widgetContainer
      The widget container for the form row.
      static int OPENER_WIDTH
      The width of the opener.
      static int WIDGET_CONTAINER_WIDTH
      The default widget container width.
      static int WIDGET_MARGIN_RIGHT
      The required right margin.
      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsFormRow()
      The default constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gwt.user.client.ui.Panel getIcon()
      Gets the icon.
      com.google.gwt.user.client.ui.Label getLabel()
      Returns the label for the form row.
      static java.lang.String getLabelWidth()
      Returns the width of the label as a string.
      static java.lang.String getOpenerWidth()
      Returns the width of the opener as a string.
      com.google.gwt.user.client.ui.Panel getWidgetContainer()
      Returns the widget container for the form row.
      static java.lang.String getWidgetContainerLeftMargin()
      Returns the left margin of the widget container as a string.
      static java.lang.String getWidgetContainerWidth()
      Returns the left margin of the widget container as a string.
      void initInfoStyle()
      Initializes the style for the info button.
      static void installTooltipEventHandlers​(com.google.gwt.user.client.ui.Panel icon, com.google.common.base.Supplier<CmsFieldTooltip.Data> dataSupplier)
      Installs the DOM event handlers for displaying tooltips on a help icon.
      void setInfo​(java.lang.String info, boolean isHtml)
      Shows the info icon and sets the information text as its title.
      void truncate​(java.lang.String textMetricsKey, int clientWidth)
      Truncates long text and sets the original text to the title attribute.
      • 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
    • Constructor Detail

      • CmsFormRow

        public CmsFormRow()
        The default constructor.
    • Method Detail

      • getLabelWidth

        public static java.lang.String getLabelWidth()
        Returns the width of the label as a string.

        Returns:
        the width of the label as a string
      • getOpenerWidth

        public static java.lang.String getOpenerWidth()
        Returns the width of the opener as a string.

        Returns:
        the width of the opener as a string
      • getWidgetContainerLeftMargin

        public static java.lang.String getWidgetContainerLeftMargin()
        Returns the left margin of the widget container as a string.

        Returns:
        the left margin of the widget container as a string
      • getWidgetContainerWidth

        public static java.lang.String getWidgetContainerWidth()
        Returns the left margin of the widget container as a string.

        Returns:
        the left margin of the widget container as a string
      • installTooltipEventHandlers

        public static void installTooltipEventHandlers​(com.google.gwt.user.client.ui.Panel icon,
                                                       com.google.common.base.Supplier<CmsFieldTooltip.Data> dataSupplier)
        Installs the DOM event handlers for displaying tooltips on a help icon.

        The supplier passed in should not create a new tooltip data instance each time, but cache the different possible tooltip data instances.

        Parameters:
        icon - the help icon
        dataSupplier - provides the tooltip data at the time the DOM events occur
      • getIcon

        public com.google.gwt.user.client.ui.Panel getIcon()
        Gets the icon.

        Returns:
        the icon
      • getLabel

        public com.google.gwt.user.client.ui.Label getLabel()
        Returns the label for the form row.

        Returns:
        the label for the form row
      • getWidgetContainer

        public com.google.gwt.user.client.ui.Panel getWidgetContainer()
        Returns the widget container for the form row.

        Returns:
        the widget container for the form row
      • initInfoStyle

        public void initInfoStyle()
        Initializes the style for the info button.

      • setInfo

        public void setInfo​(java.lang.String info,
                            boolean isHtml)
        Shows the info icon and sets the information text as its title.

        Parameters:
        info - the info
        isHtml - true if info should be interpreted as HTML rather than plain text