EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.jquery
Class DateField

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by echopoint.jquery.DateField
All Implemented Interfaces:
Alignable, Delegateable, Heightable, Sizeable, Widthable, Serializable, RenderIdSupport

public class DateField
extends Component
implements Sizeable, Alignable

DateField is a drop down component that contains a text field and a drop down calendar. The text field is updated with the contents of the DateField calendar. DateField is both a date- and time picker. If the component should be used as a time-picker the DateFormat must include an hour field, e.g. setDateFormat("dd.MM.yyyy HH:mm") It is based on the jQuery plugin DynDateTime

Version:
$Id: DateField.java 242 2009-09-29 20:16:11Z aschild $
Author:
Hans Holmlund - 2009-04-03
See Also:
Serialized Form

Field Summary
static String cssReference
           
static String DATE_CHANGED_PROPERTY
           
static ImageReference imageReference
           
protected static Logger logger
          The logger to use to log the download progress.
static String PROPERTY_BORDER
           
static String PROPERTY_CALENDAR_ICON
           
static String PROPERTY_CSS
           
static String PROPERTY_DATEFORMAT
           
static String PROPERTY_EDITABLE
           
static String PROPERTY_FIRST_DAY_OF_WEEK
           
static String PROPERTY_INPUT_HEIGHT
           
static String PROPERTY_INPUT_WIDTH
           
static String PROPERTY_INSETS
           
static String PROPERTY_LANGUAGE
           
static String PROPERTY_SHOW_WEEKS
           
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.able.Widthable
PROPERTY_WIDTH
 
Fields inherited from interface echopoint.able.Heightable
PROPERTY_HEIGHT
 
Fields inherited from interface echopoint.able.Alignable
PROPERTY_ALIGNMENT
 
Constructor Summary
DateField()
          Creates a new CalendarSelect.
DateField(Calendar calendar)
           
DateField(Date date)
          Creates a new CalendarSelect.
 
Method Summary
 Alignment getAlignment()
          Returns the alignment of the DateField component.
 Border getBorder()
          Returns the border surrounding the entire component.
 String getCSS()
          Returns the cascading style sheet for this calendar.
 Date getDate()
          Returns the selected date.
 String getDateFormat()
           
 String getDateStr()
           
static String getFileAsString(String resource)
           
 int getFirstDayOfWeek()
          Returns the first day of the week
 Extent getHeight()
          Returns the height extent of DateField component.
 ImageReference getIcon()
          Returns the icon displayed in the calendar button.
 Extent getInputHeight()
          Returns the input field height.
 Extent getInputWidth()
          Returns the input field width.
 Insets getInsets()
          Returns the inset margin of the content.
 boolean getShowWeeks()
          Returns the status of week number display
 Extent getWidth()
          Returns the width extent of the DateField component.
 boolean isEditable()
          Determines the editable state of this component.
 void processInput(String inputName, Object inputValue)
           
 void setAlignment(Alignment newValue)
          Sets the alignment of the DateField component.
 void setBorder(Border newValue)
          Sets the border surrounding the entire component.
 void setCSS(String newValue)
          Sets the cascading style sheet for this calendar.
 void setDate(Date newValue)
          Sets the selected date.
 void setDateFormat(String dateFormat)
          Sets the date format for this calendar.
 void setEditable(boolean newValue)
          Sets the editable state of this component.
 void setFirstDayOfWeek(int newValue)
          Sets the the first day of week.
 void setHeight(Extent newValue)
          Sets the height extent of the DateField component.
 void setIcon(ImageReference newValue)
          Sets the icon displayed in the calendar button.
 void setInputHeight(Extent newValue)
          Sets the editable state of this component.
 void setInputWidth(Extent newValue)
          Sets the width of the input field for the date.
 void setInsets(Insets newValue)
          Sets the inset margin of the content.
 void setShowWeeks(boolean newValue)
          Sets the display of week numbers
 void setWidth(Extent newValue)
          Sets the width extent of the DateField component.
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopoint.able.Delegateable
getRenderProperty, getRenderProperty
 

Field Detail

logger

protected static final Logger logger
The logger to use to log the download progress.


DATE_CHANGED_PROPERTY

public static final String DATE_CHANGED_PROPERTY
See Also:
Constant Field Values

PROPERTY_EDITABLE

public static final String PROPERTY_EDITABLE
See Also:
Constant Field Values

PROPERTY_DATEFORMAT

public static final String PROPERTY_DATEFORMAT
See Also:
Constant Field Values

PROPERTY_BORDER

public static final String PROPERTY_BORDER
See Also:
Constant Field Values

PROPERTY_CALENDAR_ICON

public static final String PROPERTY_CALENDAR_ICON
See Also:
Constant Field Values

PROPERTY_CSS

public static final String PROPERTY_CSS
See Also:
Constant Field Values

PROPERTY_INSETS

public static final String PROPERTY_INSETS
See Also:
Constant Field Values

PROPERTY_LANGUAGE

public static final String PROPERTY_LANGUAGE
See Also:
Constant Field Values

imageReference

public static final ImageReference imageReference

cssReference

public static final String cssReference

PROPERTY_INPUT_WIDTH

public static final String PROPERTY_INPUT_WIDTH
See Also:
Constant Field Values

PROPERTY_INPUT_HEIGHT

public static final String PROPERTY_INPUT_HEIGHT
See Also:
Constant Field Values

PROPERTY_SHOW_WEEKS

public static final String PROPERTY_SHOW_WEEKS
See Also:
Constant Field Values

PROPERTY_FIRST_DAY_OF_WEEK

public static final String PROPERTY_FIRST_DAY_OF_WEEK
See Also:
Constant Field Values
Constructor Detail

DateField

public DateField()
Creates a new CalendarSelect.


DateField

public DateField(Calendar calendar)

DateField

public DateField(Date date)
Creates a new CalendarSelect.

Parameters:
date - the initially selected date
Method Detail

setDateFormat

public void setDateFormat(String dateFormat)
                   throws IllegalArgumentException
Sets the date format for this calendar. Depending on the date format the USETIME property will be automatically set.

Parameters:
dateFormat -
Throws:
IllegalArgumentException

getDateFormat

public String getDateFormat()

setInsets

public void setInsets(Insets newValue)
Sets the inset margin of the content. Values may only be specified in pixel-based units.

Parameters:
newValue - the new inset margin

getInsets

public Insets getInsets()
Returns the inset margin of the content.

Returns:
newValue the inset margin

setIcon

public void setIcon(ImageReference newValue)
Sets the icon displayed in the calendar button.

Parameters:
newValue - the new icon

getCSS

public String getCSS()
Returns the cascading style sheet for this calendar.

Returns:
the cascading style sheet

setCSS

public void setCSS(String newValue)
Sets the cascading style sheet for this calendar.

Parameters:
newValue - the new icon

getAlignment

public Alignment getAlignment()
Returns the alignment of the DateField component.

Specified by:
getAlignment in interface Alignable
Returns:
the alignment

setAlignment

public void setAlignment(Alignment newValue)
Sets the alignment of the DateField component.

Specified by:
setAlignment in interface Alignable
Parameters:
newValue - the new alignment

getIcon

public ImageReference getIcon()
Returns the icon displayed in the calendar button.

Returns:
the icon

getBorder

public Border getBorder()
Returns the border surrounding the entire component.

Returns:
the border

setWidth

public void setWidth(Extent newValue)
Sets the width extent of the DateField component.

Specified by:
setWidth in interface Widthable
Parameters:
newValue - - the new width extent of the DateField component

getWidth

public Extent getWidth()
Returns the width extent of the DateField component.

Specified by:
getWidth in interface Widthable
Returns:
the width extent of the DateField component.

setHeight

public void setHeight(Extent newValue)
Sets the height extent of the DateField component.

Specified by:
setHeight in interface Heightable
Parameters:
newValue - - the new height extent of the DateField component

getHeight

public Extent getHeight()
Returns the height extent of DateField component.

Specified by:
getHeight in interface Heightable
Returns:
the height extent of DateField component.

getDate

public Date getDate()
Returns the selected date.

Returns:
the selected date

getDateStr

public String getDateStr()

processInput

public void processInput(String inputName,
                         Object inputValue)
Overrides:
processInput in class Component
See Also:
Component.processInput(java.lang.String, java.lang.Object)

setBorder

public void setBorder(Border newValue)
Sets the border surrounding the entire component.

Parameters:
newValue - the new border

setDate

public void setDate(Date newValue)
Sets the selected date.

Parameters:
newValue - the new date

setEditable

public void setEditable(boolean newValue)
Sets the editable state of this component.

Parameters:
newValue - the new editable state

isEditable

public boolean isEditable()
Determines the editable state of this component.

Returns:
true if this component is editable

getFileAsString

public static String getFileAsString(String resource)

getInputWidth

public Extent getInputWidth()
Returns the input field width.

Returns:
The input field width

setInputWidth

public void setInputWidth(Extent newValue)
Sets the width of the input field for the date.

Parameters:
newValue - the new width of the input field

getInputHeight

public Extent getInputHeight()
Returns the input field height.

Returns:
The input field height

setInputHeight

public void setInputHeight(Extent newValue)
Sets the editable state of this component.

Parameters:
newValue - the new height of the input field

getFirstDayOfWeek

public int getFirstDayOfWeek()
Returns the first day of the week

Returns:
The first day of the week. (0=Sunday, 1= Monday etc.)

setFirstDayOfWeek

public void setFirstDayOfWeek(int newValue)
Sets the the first day of week. Used to calculate week numbers. Usually 0 for US (Sunday) and 1 for europe (Monday)

Parameters:
newValue - (0=Sunday, 1= Monday etc.)

getShowWeeks

public boolean getShowWeeks()
Returns the status of week number display

Returns:
The week number display mode

setShowWeeks

public void setShowWeeks(boolean newValue)
Sets the display of week numbers

Parameters:
newValue - Should week numbers be displayed?

EchoPoint API - 3.0.0b5
App Webcontainer