Spiffy UI Framework

org.spiffyui.client.widgets
Class TimePickerTextBox

java.lang.Object
  extended by TextBox
      extended by org.spiffyui.client.widgets.TimePickerTextBox

public class TimePickerTextBox
extends TextBox

This widget uses a simple GWT TextBox and attaches the JQuery time picker. When the field gets focus the date picker will become visible.


Constructor Summary
TimePickerTextBox()
          Create a TimePickerTextBox with a random ID.
TimePickerTextBox(java.lang.String id)
          Create a TimePickerTextBox with the specified ID.
 
Method Summary
 int getHours()
          Gets the current hours value of the text box
 int getMinutes()
          Gets the current minutes value of the text box
 boolean isEmpty()
          Convenience method to determine if the value is empty since the getHours and getMinutes will return -1 for empty as well as unparseable.
 void onAttach()
           
 void onPreviewNativeEvent(NativePreviewEvent event)
           
 void setDateValue(java.util.Date date)
          Sets the value to be the short time of the date
 void setDateValueRounded(java.util.Date date)
          Sets the value to be the time of the date on the or rounded up to the nearest hour or half hour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimePickerTextBox

public TimePickerTextBox()
Create a TimePickerTextBox with a random ID. The ID is required because the JQuery data picker needs a specific ID to connect to.


TimePickerTextBox

public TimePickerTextBox(java.lang.String id)
Create a TimePickerTextBox with the specified ID. The ID is required because the JQuery data picker needs a specific ID to connect to.

Parameters:
id - the id for the text box
Method Detail

onAttach

public void onAttach()

setDateValue

public void setDateValue(java.util.Date date)
Sets the value to be the short time of the date

Parameters:
date - the date value to set

setDateValueRounded

public void setDateValueRounded(java.util.Date date)
Sets the value to be the time of the date on the or rounded up to the nearest hour or half hour

Parameters:
date - the date value to set

getHours

public int getHours()
Gets the current hours value of the text box

Returns:
the hours value or -1 if it isn't specified

getMinutes

public int getMinutes()
Gets the current minutes value of the text box

Returns:
the hours value or -1 if it isn't specified

isEmpty

public boolean isEmpty()
Convenience method to determine if the value is empty since the getHours and getMinutes will return -1 for empty as well as unparseable.

Returns:
boolean true if empty

onPreviewNativeEvent

public void onPreviewNativeEvent(NativePreviewEvent event)

Spiffy UI Framework