Class JDPDate

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPDate

public class JDPDate
extends Panel
Class JDPDate represents a date textfield with pulldown ability.


Constructor Index

 o JDPDate(JDPUser)
 o JDPDate(JDPUser, int)
 o JDPDate(JDPUser, String, int)

Method Index

 o format(Date)
Format a given date to the default format
 o format(Date, String)
Format a given date to a given format
 o format(long)
Format a given date to the default format
 o format(String)
Format a given date to the default format
 o format(String, String)
Format a given date to the default format
 o formatForSql(Date, String)
Format a given date string create the SQL to update it to the database
 o formatForSql(String, String)
Format a given date string create the SQL to update it to the database
 o formatSystem(long)
Format a given date to the default system format yyyy/mm/dd.
 o getBackground()
 o getColumns()
Get the number of columns for the date box
 o getDate()
Get the value of the date box
 o getDefaultFormat()
Get the value of the date box
 o getEditable()
Get the editable setting of the date box
 o getEnabled()
Get the enabled setting of the date box
 o getFont()
 o getForeground()
 o getText()
Get the value of the date box
 o handleEvent(Event)
 o minimumSize()
 o preferredSize()
 o setBackground(Color)
 o setDate(Date)
Set the value of the date box
 o setDefaultFormat(String)
Set the default date format
 o setEditable(boolean)
Set the editable setting of the date box
 o setEnabled(boolean)
Set the enabled setting of the date box
 o setFont(Font)
 o setForeground(Color)
 o setText(String)
Set the value of the date box
 o unformat(String)
Format a given date string create a date using the default format
 o unformat(String, String)
Format a given date string create a date given the format
 o unformattedDateValid()
Check whether the last date unformatted was invalid.

Constructors

 o JDPDate
 public JDPDate(JDPUser user)
 o JDPDate
 public JDPDate(JDPUser user,
                int width)
 o JDPDate
 public JDPDate(JDPUser user,
                String initValue,
                int width)

Methods

 o setText
 public void setText(String newText)
Set the value of the date box

Parameters:
newValue - the new value for the date box
 o setDate
 public void setDate(Date date)
Set the value of the date box

Parameters:
date - the new value for the date box
 o getDate
 public Date getDate()
Get the value of the date box

Returns:
the value for the date box
 o getText
 public String getText()
Get the value of the date box

Returns:
the current value for the date box
 o getColumns
 public int getColumns()
Get the number of columns for the date box

Returns:
the number of columns for the date box
 o setDefaultFormat
 public static void setDefaultFormat(String dateFormat)
Set the default date format

Parameters:
dateFormat - the default date format
 o getDefaultFormat
 public static String getDefaultFormat()
Get the value of the date box

Returns:
the default date format
 o format
 public static String format(String thisDate)
Format a given date to the default format

Parameters:
date - the date to format
Returns:
the new newly formatted date
 o format
 public static String format(long thisDate)
Format a given date to the default format

Parameters:
date - the date to format
Returns:
the new newly formatted date
 o formatSystem
 public static String formatSystem(long thisDate)
Format a given date to the default system format yyyy/mm/dd.

Parameters:
date - the date to format
Returns:
the new newly formatted date
 o format
 public static String format(String thisDate,
                             String format)
Format a given date to the default format

Parameters:
date - the date to format
format - the format of the date (eg: "mm/dd/yy")
Returns:
the new newly formatted date
 o format
 public static String format(Date thisDate)
Format a given date to the default format

Parameters:
date - the date to format
Returns:
the new newly formatted date
 o format
 public static String format(Date thisDate,
                             String format)
Format a given date to a given format

Parameters:
date - the date to format
format - the format of the date (eg: "mm/dd/yy")
Returns:
the new newly formatted date
 o formatForSql
 public static String formatForSql(String thisDate,
                                   String datasourceType)
Format a given date string create the SQL to update it to the database

Parameters:
date - the date to parse
datasourceType - the type of datasource we are writing to
Returns:
the SQL subclause
 o formatForSql
 public static String formatForSql(Date thisDate,
                                   String datasourceType)
Format a given date string create the SQL to update it to the database

Parameters:
date - the date to parse
datasourceType - the type of datasource we are writing to
Returns:
the SQL subclause
 o unformat
 public static Date unformat(String thisDate)
Format a given date string create a date using the default format

Parameters:
date - the date to parse
Returns:
the new date
 o unformat
 public static Date unformat(String thisDate,
                             String format)
Format a given date string create a date given the format

Parameters:
date - the date to parse
format - the format of the date (eg: "mm/dd/yy")
Returns:
the new date
 o unformattedDateValid
 public static boolean unformattedDateValid()
Check whether the last date unformatted was invalid.

Returns:
whether the last date unformatted was invalid.
 o setBackground
 public void setBackground(Color thisColor)
Overrides:
setBackground in class Component
 o getBackground
 public Color getBackground()
Overrides:
getBackground in class Component
 o setForeground
 public void setForeground(Color thisColor)
Overrides:
setForeground in class Component
 o getForeground
 public Color getForeground()
Overrides:
getForeground in class Component
 o setFont
 public void setFont(Font thisFont)
Overrides:
setFont in class Component
 o getFont
 public Font getFont()
Overrides:
getFont in class Component
 o setEditable
 public void setEditable(boolean editable)
Set the editable setting of the date box

Parameters:
editable - the editable setting for the date box
 o getEditable
 public boolean getEditable()
Get the editable setting of the date box

Returns:
the editable setting for the date box
 o setEnabled
 public void setEnabled(boolean enabled)
Set the enabled setting of the date box

Parameters:
enabled - the enabled setting for the date box
Overrides:
setEnabled in class Component
 o getEnabled
 public boolean getEnabled()
Get the enabled setting of the date box

Returns:
the enabled setting for the date box
 o handleEvent
 public boolean handleEvent(Event e)
Overrides:
handleEvent in class Component
 o preferredSize
 public Dimension preferredSize()
Overrides:
preferredSize in class Container
 o minimumSize
 public Dimension minimumSize()
Overrides:
minimumSize in class Container