/* * $Id: //depot/prod/sumo/main/src/toolkit/netapp/sumo/toolkit/gui/util/calendar/JDateChooserWrapper.java#3 $ * * Created on Jul 12, 2005 * * Copyright (c) 2005 Network Appliance, Inc. * All rights reserved. */ package netapp.sumo.toolkit.gui.util.calendar; import com.toedter.calendar.JDateChooser; import javax.swing.ImageIcon; import java.awt.Dimension; /** * @author talley * * This is a wrapper of JCalendar's JDateChooser for the purpose of honoring the * LGPL license. It wraps by extension because of the intricacies and extreme difficulty * of wrapping a Swing class. * * There are other constructors not wrapped at this time for conciseness. * */ public class JDateChooserWrapper extends JDateChooser { public JDateChooserWrapper() { super(); } /** * Creates a new JDateChooser object with given date format string. The default date format * string is "MMMMM d, yyyy". * * @param dateFormatString the date format string * @param startEmpty true, if the date field should be empty */ public JDateChooserWrapper(String dateFormatString, boolean startEmpty, ImageIcon icon) { super(null, dateFormatString, startEmpty, icon); } /** * Calls up to the parent class' gui components to enable/disable individually. */ public void setEnabled(boolean enabled) { calendarButton.setEnabled(enabled); dateSpinner.setEnabled(enabled); editor.setEnabled(enabled); } /** * Set the size of the dateSpinner component */ public void setSize(int width, int height) { dateSpinner.setMinimumSize(new Dimension(200,2)); dateSpinner.setMaximumSize(new Dimension(200,2)); dateSpinner.setPreferredSize(new Dimension(200,2)); } }