Class FWDaySubComponent

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class FWDaySubComponent extends FWAbstractFormSubComponent implements ActionListener
A FWDaySubComponent displays a calendar view of a specific month in a specific year and lets the user choose a from a range of days in that month. Next to the days, the number of the current week in the year s also displayed.

The displayed month can be changed at runtime using the updateLabels function.

Whenever a day is selected, the control notifies registered ChangeListeners by firing a stateChanged event. Apart from listening to events, the currently selected day may be obtained or changed at any time using the getValue() and setValue functions.

Author:
ckunze
See Also:
  • Constructor Details

    • FWDaySubComponent

      public FWDaySubComponent(int aYear, int aMonth, int aMinDay, int aMaxDay, int aDefaultDay, net.simplace.core.FWObservable aObservable, Map<String,Object> aFormComponentParameterMap)
      Parameters:
      aYear - Year whose days are going to be displayed
      aMonth - Month whose days are going to be displayed (1-12)
      aMinDay - First selectable day in month
      aMaxDay - Last selectable day in month
      aDefaultDay - Number of preselected day
      aObservable - parameters of the functionality
      aFormComponentParameterMap - parameters of the containing form component
  • Method Details

    • updateLabels

      public void updateLabels(int aYear, int aMonth, int aMinDay, int aMaxDay, int aDefaultDay)
      Displays the month specified by aYear and aMonth and makes all days between aMinDay and aMaxDay selectable. In this new calendar view, aDefaultDay will be preselected. The week numbers shown are ISO weeks (IsoFields.WEEK_OF_WEEK_BASED_YEAR, weeks start on Monday like the calendar rows).
      Parameters:
      aYear - year to display
      aMonth - month to display (1-12)
      aMinDay - first selectable day
      aMaxDay - last selectable day
      aDefaultDay - preselected day (clamped to the selectable range)
    • getValue

      public String getValue()
      Specified by:
      getValue in class FWAbstractFormSubComponent
      Returns:
      the selected day of month, or null without selection
    • setValue

      public void setValue(String aValue)
      Selects the day, if it is visible and selectable.
      Specified by:
      setValue in class FWAbstractFormSubComponent
      Parameters:
      aValue - day of month
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Notifies the listeners that a day was selected.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - the button event
    • getSelectedValueList

      public List<Object> getSelectedValueList()
      Not implemented.
      Specified by:
      getSelectedValueList in class FWAbstractFormSubComponent
      Returns:
      always null