Class DateForm

All Implemented Interfaces:
com.github.tadukoo.util.pojo.MappedPojo, Form, SimpleForm, ImageObserver, MenuContainer, Serializable, Accessible

public class DateForm extends AbstractSimpleForm
Date Form is a Form used to store a Date.
Since:
Alpha v.0.2.1
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
See Also:
  • Field Details

  • Constructor Details

    • DateForm

      public DateForm(Date date, int minYear, int maxYear) throws Throwable
      Creates a new Date Form with the given parameters
      Parameters:
      date - The Date to have filled in, or null
      minYear - The minimum year to allow
      maxYear - The maximum year to allow
      Throws:
      Throwable - If anything goes wrong in creating components - shouldn't in this case
  • Method Details

    • labelsOnTop

      public boolean labelsOnTop()
      Returns:
      Whether to have labels for components above them (true) or to the left (false) - defaults to true
    • setDefaultFields

      public void setDefaultFields()
      This method should be called by the constructor to set default fields (this is where you should create new FormFields by calling SimpleForm.addField(FormField))
    • getMonth

      public Month getMonth()
      Returns:
      The Month
    • getMonthString

      public String getMonthString()
      Returns:
      The Month as a string
    • setMonth

      public void setMonth(Month month)
      Set the Month for this Date
      Parameters:
      month - The Month to be set
    • setMonth

      public void setMonth(String month)
      Sets the Month for this Date
      Parameters:
      month - The Month to be set
    • getDay

      public int getDay()
      Returns:
      The day of the month
    • setDay

      public void setDay(int day)
      Sets the day of the month
      Parameters:
      day - The day of the month to be set
    • getYear

      public int getYear()
      Returns:
      The year
    • setYear

      public void setYear(int year)
      Sets the year
      Parameters:
      year - The year to be set
    • getMinYear

      public int getMinYear()
      Returns:
      The minimum year allowed
    • getMaxYear

      public int getMaxYear()
      Returns:
      The maximum year allowed
    • getDate

      public Date getDate()
      Returns:
      The currently set Date