Klasse FWMonthSubComponent

Alle implementierten Schnittstellen:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener

public class FWMonthSubComponent extends FWAbstractFormSubComponent implements ChangeListener
An FWMonthSubComponent displays a spinner with a list of months that the user can choose from.

Its constructor takes the numbers of the first month and the last month that should be displayed and optionally the number of the month that should be preselected. The months that are displayed in the list can be changed at runtime using the updateMonthsInList function.

Whenever the user selects a month, a stateChanged event is fired. At any time, it is possible to query the currently selected month using getValue or to set the currently selected month using setValue.

Months are numbered from 1 to 12!

International month names will be obtained from the locale.

Autor:
ckunze
Siehe auch:
  • Konstruktordetails

    • FWMonthSubComponent

      public FWMonthSubComponent(int aMin, int aMax, FWObservable aObservable, Map<String,Object> aFormComponentParameterMap)
      Constructs a FWMonthSubComponent offering the months from aMin to aMax to choose from. The first month in the list will be selected by default. Months are numbered from 1 to 12.
      Parameter:
      aMin -
      aMax -
      aObservable -
      aFormComponentParameterMap -
    • FWMonthSubComponent

      public FWMonthSubComponent(int aMin, int aMax, int aDefault, boolean aIsEnabled, FWObservable aObservable, Map<String,Object> aFormComponentParameterMap)
      Parameter:
      aMin - Number (1-12) of the first month in the list.
      aMax - Number (1-12) of the last month in the list.
      aDefault - Number (1-12) of the month that will be selected initially.
      aIsEnabled -
      aObservable -
      aFormComponentParameterMap -
  • Methodendetails

    • getValue

      public String getValue()
      Angegeben von:
      getValue in Klasse FWAbstractFormSubComponent
      Gibt zurück:
      the currently seected month (0-11)
    • setValue

      public void setValue(String aValue)
      Selects the combo box item that corresponds to the given month or the first item if the given month does not exist in the list.
      Angegeben von:
      setValue in Klasse FWAbstractFormSubComponent
      Parameter:
      aValue - The month to be selected (1-12)
    • updateMonthsInList

      public void updateMonthsInList(int aMin, int aMax)
      Rebuilds the combo's list so it contains months from aMin to aMax. After that, the same month as before is selected. If the previously selected month is no longer in the list, the first or last month from the list will be selected.
      Parameter:
      aMin - First selectable month (1-12)
      aMax - Last selectable month (1-12)
    • setEnabled

      public void setEnabled(boolean aIsEnabled)
      Setzt außer Kraft:
      setEnabled in Klasse FWAbstractFormSubComponent
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Angegeben von:
      stateChanged in Schnittstelle ChangeListener
    • getSelectedValueList

      public List<Object> getSelectedValueList()
      Angegeben von:
      getSelectedValueList in Klasse FWAbstractFormSubComponent
      Gibt zurück:
      value of the implemented subcomponent