kiwi.ui
Class DateRangeHelper

java.lang.Object
  extended bykiwi.ui.DateRangeHelper
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class DateRangeHelper
extends java.lang.Object
implements java.awt.event.ActionListener

A helper class for coordinating two DateChoosers for the purpose of entering a date range. DateRangeHelper constrains two DateChoosers in such a way that only a valid date range may be selected using the two choosers. To this end, an end date must be entered that is on or after the start date. The date range selection can be further constrained by specifing a minimum and maximum date; in this case input is limited so that the selected date range will fall within the constrained range.


DateRangeHelper in action.

Author:
Mark Lindner, PING Software Group

Field Summary
private  DateChooser endChooser
           
private  DateChooser startChooser
           
 
Constructor Summary
DateRangeHelper(DateChooser startChooser, DateChooser endChooser)
          Construct a new DateRangeHelper for the specified start and end date choosers.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Handle events.
 java.util.Calendar getEndDate()
          Get the currently selected end date.
 java.util.Calendar getStartDate()
          Get the currently selected start date.
 void setEndDate(java.util.Calendar date)
          Set the end date.
 void setMaximumDate(java.util.Calendar date)
          Set the maximum selectable date for this date range.
 void setMinimumDate(java.util.Calendar date)
          Set the minimum selectable date for this date range.
 void setStartDate(java.util.Calendar date)
          Set the start date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startChooser

private DateChooser startChooser

endChooser

private DateChooser endChooser
Constructor Detail

DateRangeHelper

public DateRangeHelper(DateChooser startChooser,
                       DateChooser endChooser)
Construct a new DateRangeHelper for the specified start and end date choosers.

Parameters:
startChooser - The DateChooser for selecting a start date.
endChooser - The DateChooser for selecting an end date.
Method Detail

setMinimumDate

public void setMinimumDate(java.util.Calendar date)
Set the minimum selectable date for this date range.

Parameters:
date - The minimum date.

setMaximumDate

public void setMaximumDate(java.util.Calendar date)
Set the maximum selectable date for this date range.

Parameters:
date - The maximum date.

getStartDate

public java.util.Calendar getStartDate()
Get the currently selected start date.

Returns:
The start date.

getEndDate

public java.util.Calendar getEndDate()
Get the currently selected end date.

Returns:
The end date.

setStartDate

public void setStartDate(java.util.Calendar date)
Set the start date.

Parameters:
date - The new end date.

setEndDate

public void setEndDate(java.util.Calendar date)
Set the end date.

Parameters:
date - The new end date.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Handle events. This method is public as an implementation side-effect.

Specified by:
actionPerformed in interface java.awt.event.ActionListener