Klasse BooleanRadioButtonHandler

java.lang.Object
net.sf.jguiraffe.gui.builder.components.AbstractCompositeComponentHandler<Boolean,Boolean>
net.sf.jguiraffe.gui.builder.components.model.AbstractRadioButtonHandler<Boolean>
net.sf.jguiraffe.examples.tutorial.viewset.BooleanRadioButtonHandler
Alle implementierten Schnittstellen:
net.sf.jguiraffe.gui.builder.components.CompositeComponentHandler<Boolean,Boolean>, net.sf.jguiraffe.gui.forms.ComponentHandler<Boolean>

public class BooleanRadioButtonHandler extends net.sf.jguiraffe.gui.builder.components.model.AbstractRadioButtonHandler<Boolean>

A specialized ComponentHandler implementation for a radio button group with only two elements.

This handler implementation is used for the radio button group which defines the sort direction. It can be either ascending or descending. For demonstration purposes we map these values to a boolean flag (true means descending, false means ascending). It would also be possible to use an enumeration type instead. This class mainly demonstrates how a custom component handler for radio buttons can be created.

Version:
$Id: BooleanRadioButtonHandler.java 205 2012-01-29 18:29:57Z oheger $
Autor:
Oliver Heger
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Creates a new instance of BooleanRadioButtonHandler
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected int
    Returns the index of the button with the specified value.
    protected Boolean
    Returns the value of the radio button with the specified index.

    Von Klasse geerbte Methoden net.sf.jguiraffe.gui.builder.components.model.AbstractRadioButtonHandler

    getData, getUnselectedData, getUnselectedIndex, setData

    Von Klasse geerbte Methoden net.sf.jguiraffe.gui.builder.components.AbstractCompositeComponentHandler

    addHandler, getChildHandler, getChildHandlerCount, getChildHandlerIndex, getChildHandlerNameAt, getChildHandlerNames, getChildHandlers, getComponent, getOuterComponent, getType, isEnabled, setEnabled

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • BooleanRadioButtonHandler

      public BooleanRadioButtonHandler()
      Creates a new instance of BooleanRadioButtonHandler
  • Methodendetails

    • getButtonIndex

      protected int getButtonIndex(Boolean value)
      Returns the index of the button with the specified value. This method maps data values of the radio group to specific radio buttons. Because in our example true represents the descending button we return the corresponding index.
      Angegeben von:
      getButtonIndex in Klasse net.sf.jguiraffe.gui.builder.components.model.AbstractRadioButtonHandler<Boolean>
      Parameter:
      value - the data value of the radio group
      Gibt zurück:
      the index of the selected radio button
    • getDataForButton

      protected Boolean getDataForButton(int idx)
      Returns the value of the radio button with the specified index. This method determines the data value for the whole radio group based on the selected radio button. Here we return true if and only if the descending radio button is selected.
      Angegeben von:
      getDataForButton in Klasse net.sf.jguiraffe.gui.builder.components.model.AbstractRadioButtonHandler<Boolean>
      Parameter:
      idx - the index of the selected radio button
      Gibt zurück:
      the corresponding value for the whole radio group