Class CmsRadioButtonGroup

java.lang.Object
org.opencms.gwt.client.ui.input.CmsRadioButtonGroup
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>, com.google.gwt.event.shared.HasHandlers

public class CmsRadioButtonGroup extends Object implements com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>
This class coordinates multiple radio buttons and makes sure that when a radio button of a group is selected, no other radio button of the same group is selected.

Since:
8.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final <H extends com.google.gwt.event.shared.EventHandler>
    com.google.gwt.event.shared.HandlerRegistration
    addHandler(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type)
    Adds this handler to the widget.
    com.google.gwt.event.shared.HandlerRegistration
    addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
     
    void
    Deselects a selected radio button (if one is selected).
    void
    fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
     
    Returns the currently selected button, or null if none is selected.
    void
    Selects a new button and deselects the previously selected one.
    void
    setValueChangeTarget(com.google.gwt.event.logical.shared.HasValueChangeHandlers<String> target)
    Sets the new value change event target for this button group.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • addValueChangeHandler

      public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
      Specified by:
      addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>
      See Also:
      • HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
    • deselectButton

      public void deselectButton()
      Deselects a selected radio button (if one is selected).

    • fireEvent

      public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
      Specified by:
      fireEvent in interface com.google.gwt.event.shared.HasHandlers
      See Also:
      • HasHandlers.fireEvent(com.google.gwt.event.shared.GwtEvent)
    • getSelectedButton

      Returns the currently selected button, or null if none is selected.

      Returns:
      the selected button or null
    • selectButton

      public void selectButton(CmsRadioButton button)
      Selects a new button and deselects the previously selected one.

      Parameters:
      button - the button which should be selected
    • setValueChangeTarget

      public void setValueChangeTarget(com.google.gwt.event.logical.shared.HasValueChangeHandlers<String> target)
      Sets the new value change event target for this button group.

      Parameters:
      target - the value change event target
    • addHandler

      protected final <H extends com.google.gwt.event.shared.EventHandler> com.google.gwt.event.shared.HandlerRegistration addHandler(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type)
      Adds this handler to the widget.
      Type Parameters:
      H - the type of handler to add
      Parameters:
      type - the event type
      handler - the handler
      Returns:
      HandlerRegistration used to remove the handler