All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class net.e2technologies.util.ETimeField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JPanel
                                   |
                                   +----net.e2technologies.util.ETimeField

public class ETimeField
extends JPanel
implements Serializable, FocusListener, ActionListener, ETimeListener
This is the text field that can (and in most cases should) be used in conjunction with the ETimeChooser. This component takes on the basic functonality of a JTextField but also contains extra functionality to interpret callbacks from the ETimeChooser and manipulat and translate Date/Time objects. Another class can be used instead of this component, but will need to implement the necessar interfaces (ETimeListener)

See Also:
ETimeChooser, ETimeListener

Constructor Index

 o ETimeField()
Default constructor for ETimeField.

Method Index

 o actionPerformed(ActionEvent)
Notifies this component when an action is performed on its text field.
 o addFocusListener(FocusListener)
Adds a focus listener to this component's text field.
 o focusGained(FocusEvent)
Does nothing.
 o focusLost(FocusEvent)
Notifies this component when its text field looses focus.
 o getCalendar()
retrieves the current time within the component in the form of a Calendar object
 o getTime()
gets the time currently displayed within the text field
 o getTimeString()
gets the time currently displayed within the text field
 o setCalendar(Calendar)
sets the time value within this component and will also set the text field to the time of the Calendar passed in.
 o setDate(Date)
sets the text within the text field to the time passed in.
 o setEditable(boolean)
sets the text field to be editable/uneditable
 o setTime(String)
will try to set the time within the text field to the text passed in.

Constructors

 o ETimeField
 public ETimeField()
Default constructor for ETimeField. Will automatically display the current time.

Methods

 o setEditable
 public void setEditable(boolean p_editable)
sets the text field to be editable/uneditable

Parameters:
boolean - - true will enabled text field, false will diable text field from input.
 o getTimeString
 public String getTimeString()
gets the time currently displayed within the text field

Returns:
String - the contents of the text field
 o getTime
 public Date getTime()
gets the time currently displayed within the text field

Returns:
Date - the contents of the text field in the Date type
 o setTime
 public boolean setTime(String p_timeString)
will try to set the time within the text field to the text passed in. Will popup a warning message box if the String passed in is not a valid time. If the String passed is null or blank, it will set the text field to be blank.

Parameters:
String - p_timeStirng - the time to set the text field to
Returns:
boolean - true if valid time, false if invalid
 o setDate
 public void setDate(Date p_date)
sets the text within the text field to the time passed in. If the Date passed in is null, it will set the text field to blank.

Parameters:
Date - p_date - the new time to set the text to
 o setCalendar
 public void setCalendar(Calendar p_calendar)
sets the time value within this component and will also set the text field to the time of the Calendar passed in.

Parameters:
Calendar - p_calendar - the new time to set this component to
 o getCalendar
 public Calendar getCalendar()
retrieves the current time within the component in the form of a Calendar object

Returns:
Calendar - the current time within the component
 o addFocusListener
 public void addFocusListener(FocusListener p_focusListener)
Adds a focus listener to this component's text field. When the text field looses focus, it will notify the listener.

Parameters:
FocusListener - p_focusListener - the Listener object to notify when the text field looses focus
Overrides:
addFocusListener in class Component
 o focusGained
 public void focusGained(FocusEvent e)
Does nothing. Had to be implemented due to the FocusListener interface

Parameters:
FocusEvent - e
 o focusLost
 public void focusLost(FocusEvent e)
Notifies this component when its text field looses focus. Will call its registered listners to notify them of the loss in focus.

Parameters:
FocusEvent - e
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Notifies this component when an action is performed on its text field. Will cause the value within the text field to be checked for a valid time

Parameters:
ActionEvent - e

All Packages  Class Hierarchy  This Package  Previous  Next  Index