All Implemented Interfaces:
GomCheckable, GomElement, GomFormElement, GomHideable, GomLangInfoProvider, GomSearchRelevancy, GomSingleLineable, LineBreakable, Serializable

@NonExtendable public class GomToggle extends AbstractGomFormElement implements GomSingleLineable
Field to toggle between on and off state
Since:
4.0
See Also:
  • Field Details

  • Constructor Details

    • GomToggle

      public GomToggle()
  • Method Details

    • getDefaultTag

      protected String getDefaultTag()
      Description copied from class: AbstractGomElement
      Return the default tag for a gom element.
      Specified by:
      getDefaultTag in class AbstractGomElement
      Returns:
      The elements default tag.
    • getOn

      @NotNull public @NotNull DefaultGomLangInfos getOn()
      Language-dependent information for on state
      Since:
      4.0
    • getOff

      @NotNull public @NotNull DefaultGomLangInfos getOff()
      Language-dependent information for off state
      Since:
      4.0
    • getType

      public ToggleType getType()
      Display type for states
      Since:
      4.0
    • setType

      public void setType(ToggleType type)
      Sets the display type for states
      Since:
      4.0
    • getHideLabel

      public YesNo getHideLabel()
      Defines whether to hide the component's label
      Since:
      4.0
    • setHideLabel

      public void setHideLabel(YesNo hideLabel)
      Sets whether to hide the component's label
      Since:
      4.0
    • getSingleLine

      public YesNo getSingleLine()
      Indicates if the component is single-line instead of being framed
      Since:
      4.0
    • setSingleLine

      public void setSingleLine(YesNo singleLine)
      Description copied from interface: GomSingleLineable
      Make the component be single-line instead of being framed
      Specified by:
      setSingleLine in interface GomSingleLineable
    • cloneInstance

      public AbstractGomFormElement cloneInstance()
      Creates a clone of this instance
      Since:
      5.0
    • type

      @NotNull public @NotNull ToggleType type()
      Convenience API for getType() returning a non-null value
      Returns:
      the value of getType() or ToggleType.CHECKBOX if unset
      Since:
      4.0
    • hideLabel

      public boolean hideLabel()
      Convenience API for getHideLabel() returning a boolean value
      Since:
      4.0
    • singleLine

      public boolean singleLine()
      Convenience API for getSingleLine() returning a boolean value
      Since:
      4.0