src.com.toedter.calendar.MinMaxDateEvaluator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcalendar Show documentation
Show all versions of jcalendar Show documentation
JCalendar is a Java date chooser bean for graphically picking a
date. JCalendar is composed of several other Java beans, a
JDayChooser, a JMonthChooser and a JYearChooser. All these beans
have a locale property, provide several icons (Color 16x16, Color
32x32, Mono 16x16 and Mono 32x32) and their own locale property
editor. So they can easily be used in GUI builders. Also part of the
package is a JDateChooser, a bean composed of an IDateEditor (for
direct date editing) and a button for opening a JCalendar for
selecting the date.
The newest version!
package com.toedter.calendar;
import java.awt.Color;
import java.util.Date;
public class MinMaxDateEvaluator implements IDateEvaluator {
private DateUtil dateUtil = new DateUtil();
public boolean isSpecial(Date date) {
return false;
}
public Color getSpecialForegroundColor() {
return null;
}
public Color getSpecialBackroundColor() {
return null;
}
public String getSpecialTooltip() {
return null;
}
public boolean isInvalid(Date date) {
return !dateUtil.checkDate(date);
}
public Color getInvalidForegroundColor() {
return null;
}
public Color getInvalidBackroundColor() {
return null;
}
public String getInvalidTooltip() {
return null;
}
/**
* Sets the maximum selectable date. If null, the date 01\01\9999 will be
* set instead.
*
* @param max
* the maximum selectable date
*
* @return the maximum selectable date
*/
public Date setMaxSelectableDate(Date max) {
return dateUtil.setMaxSelectableDate(max);
}
/**
* Sets the minimum selectable date. If null, the date 01\01\0001 will be
* set instead.
*
* @param min
* the minimum selectable date
*
* @return the minimum selectable date
*/
public Date setMinSelectableDate(Date min) {
return dateUtil.setMinSelectableDate(min);
}
/**
* Gets the maximum selectable date.
*
* @return the maximum selectable date
*/
public Date getMaxSelectableDate() {
return dateUtil.getMaxSelectableDate();
}
/**
* Gets the minimum selectable date.
*
* @return the minimum selectable date
*/
public Date getMinSelectableDate() {
return dateUtil.getMinSelectableDate();
}
}