org.jdesktop.swingx.plaf.basic
Class BasicDatePickerUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by org.jdesktop.swingx.plaf.DatePickerUI
          extended by org.jdesktop.swingx.plaf.basic.BasicDatePickerUI

public class BasicDatePickerUI
extends DatePickerUI

The basic implementation of a DatePickerUI.

Author:
Joshua Outwater, Jeanette Winzenburg

Nested Class Summary
 class BasicDatePickerUI.EditorCancelAction
          The wrapper for the editor cancel action.
 class BasicDatePickerUI.PopupRemover
           
 
Constructor Summary
BasicDatePickerUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
 int getBaseline(int width, int height)
          Get the baseline for the specified component, or a value less than 0 if the baseline can not be determined.
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
          
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
          
 java.util.Date getSelectableDate(java.util.Date date)
          Checks the given date for validity for selection.
 void hidePopup()
          PENDING: widened access for debugging - need api to control popup visibility?
 void installUI(javax.swing.JComponent c)
           
 boolean isPopupVisible()
           
 void toggleShowPopup()
          Toggles the popups visibility after preparing internal state.
 void uninstallUI(javax.swing.JComponent c)
           
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, paint, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicDatePickerUI

public BasicDatePickerUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

installUI

public void installUI(javax.swing.JComponent c)
Overrides:
installUI in class javax.swing.plaf.ComponentUI

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)

Overrides:
getMinimumSize in class javax.swing.plaf.ComponentUI

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)

Overrides:
getPreferredSize in class javax.swing.plaf.ComponentUI

getBaseline

public int getBaseline(int width,
                       int height)
Description copied from class: DatePickerUI
Get the baseline for the specified component, or a value less than 0 if the baseline can not be determined. The baseline is measured from the top of the component.

Overrides:
getBaseline in class DatePickerUI
Parameters:
width - Width of the component to determine baseline for.
height - Height of the component to determine baseline for.
Returns:
baseline for the specified component

getSelectableDate

public java.util.Date getSelectableDate(java.util.Date date)
                                 throws java.beans.PropertyVetoException
Checks the given date for validity for selection. If valid, returns the date as appropriate in the picker's context, otherwise throws a propertyVetoException. Note that the returned date might be different from the input date, f.i. the time fields might be cleared. The input date is guaranteed to be unchanged.

Specified by:
getSelectableDate in class DatePickerUI
Parameters:
date - date to check
Returns:
the date as allowed in the context of the picker.
Throws:
java.beans.PropertyVetoException - if the given date is not valid for selection

hidePopup

public void hidePopup()
PENDING: widened access for debugging - need api to control popup visibility?


isPopupVisible

public boolean isPopupVisible()

toggleShowPopup

public void toggleShowPopup()
Toggles the popups visibility after preparing internal state.